jQWidgets Forums

jQuery UI Widgets Forums Grid Grid – Issue in using 'onselect'

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 12 years, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Grid – Issue in using 'onselect' #18370

    Keshavan
    Participant

    Hi,

    I need to execute some code, on selecting one of the columns in Grid. The said column type is ‘dropdownlist’,
    i have properly defined the data source etc,

    { text: ‘Company’, columntype: ‘dropdownlist’, datafield: ‘CompanyId’,
    initeditor: function (row, cellvalue, editor) {
    editor.jqxDropDownList({ displayMember: ‘CompanyName’, source: dataAdapater1 });
    var value = $(“#jqxgrid”).jqxGrid(‘selectrow’, row);
    $(“#CompanyId”).on(‘select’, editor, function (event)
    {
    compId = editor.jqxDropDownList(‘getSelectedIndex’);
    alert(“compId ” + compId);
    });
    }
    },
    please let me know the issue in the high lighted line in above code,

    Thanks,

    Keshavan

    Grid – Issue in using 'onselect' #18389

    Peter Stoev
    Keymaster

    Hi,

    1. It is wrong to bind to an event in the “initeditor” callback because that callback is called each time the editor is opened. So the result will be binding to the same event multiple times.

    2. I think that the binding to the “select” event is wrong, too. The code’s syntax should be:

     $("#id").on('select', function(event)).

    In addition, if you want to bind to an event of jqxDropDownList, please take a look at its API documentation. There’s a code example provided for each API member.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.