今天再做一個表格的時候需要使用到自訂一的 input 

然後想在 change 的時候去做一些事情

所以研究了一下怎麼觸發

如下

 

{
    field: 'last_xxxx',
    title: __('Last_xxxx'),
    formatter: Controller.api.last_xxxx,
    events:Controller.api.test
},

 

api: {
    bindevent: function () {
        Form.api.bindevent($("form[role=form]"));
    },
    test:{
        'change .last_xxxx': function (e, value, row, index) {
            alert('benny');
        }
    },
    last_episode: function (value, row, index) {
        return "<input type='number' id='xxxx_" + row.id + "' " +
            "value='" + value + "' " +
            "class='last_xxxx form-control' " +
            "/>";
    },
}
文章標籤
全站熱搜
創作者介紹
創作者 benny 的頭像
benny

Benny的網站開發筆記

benny 發表在 痞客邦 留言(0) 人氣(9)