1

Is there any possible solution to move or drag and drop multiple row data between two JQGrid table. The below function, i used it to select multiple rows using check box and move them down.Is there any properties in jqgrid to select multiple rows?

function downfn()
{

    Rowid = $('#grid-table').getGridParam('selrow');
    //alert(Rowid);
    if(Rowid!=null)
    {
        RowList=$('#grid-table').jqGrid('getDataIDs');
        var dselected=$('#grid-table').jqGrid('getRowData', Rowid );
        var list=RowList.length;
        for(var i=0;i<list;i++)
        {
            if(Rowid>=RowList[i])
            {
                // alert(Rowid);
            }
            else
            {
                var selected=dselected;
                var temp = $('#grid-table').jqGrid('getRowData', RowList[i] );
                $('#grid-table').jqGrid('delRowData',RowList[i] );
                $('#grid-table').jqGrid('delRowData',Rowid );
                $('#grid-table').jqGrid('addRowData', Rowid , temp );
                $('#grid-table').jqGrid('addRowData', RowList[i] , selected );
                var Rowid=RowList[i];
            }
        }
    }
}
Samsad CV
  • 126
  • 10
  • The code which you posted don't contains any drag and drop. It looks like *moving* of rows from one grid to another, but you use **the same** name `$('#grid-table')` for the source and the destination grids. So your requirements are absolutely unclear. – Oleg Nov 17 '14 at 13:05
  • is there any properties to select multiple rows from jqgdri by mouse click. – Samsad CV Nov 18 '14 at 07:35
  • I don't understand what you mean. Which rows you want to select by **one** mouse click? To select a row one can use `setSelection`. In any way the selection has no relation to moving of the rows. Your requirements are still unclear. – Oleg Nov 18 '14 at 07:52
  • i want to select multiple raws, and then move them down in the raw list. – Samsad CV Nov 18 '14 at 08:52
  • So you want just to change the order of rows in the grid? It sounds not what you asked: "drag and drop multiple row data between two JQGrid table". Selection of rows and moving some rows are absolutely independent things. Do you what that *the user* selects the rows and then your code (executed on click on the button for example) moves the selected rows ot the bottom of the grid? – Oleg Nov 18 '14 at 09:00
  • Look at [the old answer](http://stackoverflow.com/a/8138980/315935) which contains [the demo](http://www.ok-soft-gmbh.com/jqGrid/SimpleLocalGridWithSortableMultiselect1.htm). It changes the header of multiselect column so that one can sort the grid by multiselect column by clicking on the column header. It seems me almost the same what you ask. – Oleg Nov 18 '14 at 09:08
  • my requirement is like sumesh said – Samsad CV Nov 18 '14 at 13:55

0 Answers0