jQWidgets Forums

jQuery UI Widgets Forums Grid After Addrow, would like to select that row

This topic contains 1 reply, has 1 voice, and was last updated by  lkaatz99 12 years, 5 months ago.

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

  • lkaatz99
    Participant

    I have a grid where selectionmode = multiplecellsadvanced. it is set to this so I can use the keyboard naviagation, advancing thru the cells using left and right arrow keys.

    I have a button to add rows. When I call the method ‘addrow’, it works, a new row is added. But I cannot get that row to be selected ( also when it is created on page 2, and currently viewing page 1 of the grid).

    Below is my Addrow function:

    $(“#addrowbutton”).bind(‘click’, function () {
    if( ! ($(‘#addrowbutton’).attr(“disabled”)) )
    {
    var rowscount = $(“#jqxgrid”).jqxGrid(‘getdatainformation’).rowscount;
    var datarow = generaterow(rowscount + 1);

    $(‘#jqxgrid’).jqxGrid(‘addrow’, null, datarow);

    // either of the two calls below does not work
    // where columnname is the column I want to start editing. it is not selected
    $(‘#jqxgrid’).jqxGrid(‘selectcell’, rowscount, ‘columnname’);

    $(‘#jqxgrid’).jqxGrid(‘selectrow’, rowscount);

    }
    });


    lkaatz99
    Participant

    Figured out my problem:

    After server side call to add the new row, then I call selectrow, etc. All is working fine.

    Thanks.

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

You must be logged in to reply to this topic.