jQWidgets Forums

jQuery UI Widgets Forums Getting Started Jqxgrid drag/drop functionality

This topic contains 2 replies, has 2 voices, and was last updated by  akshaybagi123@gmail.com 6 years, 11 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Jqxgrid drag/drop functionality #100891

    i have two grids, successfully i am able drag and drop from one grid row to another grid row. I want to stop overriding on second grid row, when user drag a row from first grid and drop it to second grid row (when user drag a row from first grid and drop it on second existing grid row, then it should create new row instead of overriding existing row). How to achieve this?

    Jqxgrid drag/drop functionality #100903

    Martin
    Participant

    Hello akshaybagi123@gmail.com,

    You can check the row of the cell in which you drop the row:

    gridCells.on('dragEnd', function (event) {
        var value = $(this).text();
        var position = $.jqx.position(event.args);
        var cell = $("#grid2").jqxGrid('getcellatposition', position.left, position.top);
        var row = cell.row;

    And after that use the addRow method of the grid to insert the new row (for example, above this row):

    $("#grid2").jqxGrid('addrow', null, datarow, row-1)

    Best Regards,
    Martin

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

    Jqxgrid drag/drop functionality #100911

    Thanks Martin for the reply. Will add above code & will see how it behave.

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

You must be logged in to reply to this topic.