jQWidgets Forums

jQuery UI Widgets Forums Grid Issue with add row

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

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • Issue with add row #47897

    priyam.basu
    Participant

    Hi,

    So, I’m trying to add a new row to the grid, when the user starts writing something in the last blank row. But when I do that, the focus moves to the newly added row, and the user has to click on the previous row again, to start typing. How can I avoid this?

    handlekeyboardnavigation: function (event) {
    var row = $(‘#TableDefinitionGrid’).jqxGrid(‘selectedrowindex’);
    var datainformations = $(‘#TableDefinitionGrid’).jqxGrid(‘getdatainformation’);
    var rowscounts = datainformations.rowscount;
    if (row == rowscounts – 1) {
    var newTableFieldID = guid();
    var value = $(‘#TableDefinitionGrid’).jqxGrid(‘addrow’, newTableFieldID,{ ‘DisplayName’: ”, ‘InternalName’: ”, ‘Description’: ” });
    }
    //return false;
    //}
    }

    Issue with add row #47915

    Peter Stoev
    Keymaster

    Hi priyam.basu,

    Isn’t it better to add a new row after the editing is finished i.e in the “cellendedit” event handler or in the source object’s “updaterow” function.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    Issue with add row #47917

    priyam.basu
    Participant

    How do I get the index of the selected cell? getselectedcell is returning null

    Thanks you

    Issue with add row #47923

    Peter Stoev
    Keymaster

    Hi priyam.basu,

    If “getselectedcell” returns null, then there is no selected cell or you do not use any of the available cell selection modes. If that is so, then use the “getselectedrowindex” method.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    Issue with add row #47928

    priyam.basu
    Participant

    Hi,

    Is there any way that I can check when the cursor is in the last cell of the last row?

    Thanks!

    Issue with add row #47932

    Peter Stoev
    Keymaster

    Hi priyam.basu,

    No, there’s no API for checking that.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

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

You must be logged in to reply to this topic.