1

我正在使用带有列表和许多其他东西的w2ui网格内联编辑。

如何收听元素的onselect事件?

$('#grid').w2grid({
     name: 'grid',
     columns: [
        {
             field: 'fieldname',caption: 'caption',sortable: true,
             editable: {
                 type: 'list',
                 items: people,
                 showAll: true 
                }           
             }
     ],....    
4

1 回答 1

0

尝试如下所示并访问链接以获取详细信息。

w2ui.grid.on('change', function(event) {
    console.log(event);
});

或者

您也可以在创建网格时添加它。

$('#grid').w2grid({
    name    : 'grid',
    // . . . . . . . 
    onChange: function(event) {
        console.log(event);
    }        
});

http://w2ui.com/web/docs/w2grid.onChange

于 2015-12-09T09:40:24.420 回答