jQuery UI Widgets Forums Grid Using the DropDownList column type in the jqxGrid

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

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

  • grozavule
    Member

    After a dropdownlist field has been edited in the jqxGrid, I would like to access the index of the selected item in the dropdownlist. How can I do that?


    Peter Stoev
    Keymaster

    Hi grozavule,

    You can retrieve the editor’s value in a function called cellendedit:

    Example:

    { text: 'Product', columntype: 'dropdownlist', datafield: 'productname',
    cellendedit: function (row, datafield, columntype, newValue, editorvalue) {
    }
    },

    After the cell’s editing is done, the editor is removed and it is not possible to access it..

    A way to get selected index when the user selects it is to bind to the DropDownList’s ‘select’ event and get the selected index in the event handler.

    { text: 'Product', columntype: 'dropdownlist', datafield: 'productname', width: 177,
    cellendedit: function (row, datafield, columntype, newValue, editorvalue) {
    },
    createeditor: function (row, column, editor) {
    editor.bind('select', function (event) {
    var selectedIndex = event.args.index;
    });
    }
    },

    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.