jQuery UI Widgets Forums Grid addrow

This topic contains 3 replies, has 3 voices, and was last updated by  abasan 7 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    addrow Posts
  • addrow #97547

    abasan
    Participant

    hi

    I have one problem

    how can add new row at first of grid rows when call addrow method

    I use grid with following option

    
    virtualmode: true,
    pageable: true,
    
    addrow #97558

    Stanislav
    Participant

    Hello abasan,

    You need to call the ‘addrow’ method and give it the parameters it needs.
    I suggest taking a look at our API.
    You will need to add the desired position in the example.

    Best Regards,
    Stanislav

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

    addrow #97560

    iroshi7e7
    Participant

    I have add a row where user select row,
    this is my code,( I provide JQX menu)

    if ($.trim($(args).text()) == “Insert Row”) {
    debugger;
    var args = event.args;
    var selectedRowindex = $(“#jqxBoqgrid”).jqxGrid(‘getselectedrowindex’);
    var DestinationRowIndex = selectedRowindex + 1;
    $(‘#jqxBoqgrid’).jqxGrid(‘addrow’, selectedRowindex, {}, DestinationRowIndex);
    }

    I can add row any place, but when I edit this row, next row also replaced , I have several drop downs on row and when change these rows only automatically replaced next row record)

    ( …………..
    geteditorvalue: function (row, cellvalue, editor) {
    var unitItem = editor.jqxDropDownList(“getSelectedItem”);
    return unitItem.label;
    )

    I am really appreciated if you can help me to solve this issue. Client wants to add row anywhere to grid and I should keep a sequence when print report

    addrow #97684

    abasan
    Participant

    hello iroshi7e7

    I think you pass row id in correct

    
    var value = $('#jqxGrid').jqxGrid('addrow', rowid, newdata,rowPosition);
    @param row id. Pass null, if you want the new id to be auto-generated or pass a row id.
    @param row data. The expected value is a JSON Object.
    

    if you pass selectedRowindex for new row id it replace selectedRow
    try pass null or row id that is not used before.

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

You must be logged in to reply to this topic.