Search code examples
jquerygriddropdownw2ui

w2ui - Inline edit grid with list. under grid i need to call onselect for each dropdown


I am using w2ui grid in-line edit with list and many other stuff.

How can I listen to the onselect event of an element ?

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

Solution

  • Try like below and visit the link for detailed information.

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

    OR

    You can add this during grid creation as well.

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

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