I have seen this issue raised elsewhere but have not got the ideas to work.
I have three grids A,B,C. with the following code I can drag and drop from A to B, A to C, B to C which is what I want. However, I want to also be able to sort rows in B which does not work.
in Grid A
1 2 3 4 5 |
$dropr = <<< DROPR jQuery('#A').jqGrid('gridDnD',{connectWith:'#C,#B' }); DROPR; $grid->setJSCode($dropr); |
in Grid B
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
$dragdropf = <<< DRAGF jQuery('#B').jqGrid('gridDnD', {connectWith:'#C', ondrop: function(evt, obj, data){ data.droppedon=evt.target.id; data.testid={$id}; $.ajax({ method: "POST", url: "ajaxAddLink.php", data: data, success: (function(){ $('#C').trigger( 'reloadGrid' ); $('#B').trigger( 'reloadGrid' ); }) }) } } ); DRAGF; $grid->setJSCode($dragdropf); $grid->callGridMethod('#B','sortableRows'); |
In grid C
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
$dragdropr = <<< DRAGR jQuery('#C').jqGrid('gridDnD', {connectWith:'#B', ondrop: function(evt, obj, data){ data.droppedon=evt.target.id; data.testid={$id}; $.ajax({ method: "POST", url: "ajaxAddLink.php", data: data, success: (function(){ $('#C').trigger( 'reloadGrid' ); $('#B').trigger( 'reloadGrid' ); }) }) } } ); DRAGR; $grid->setJSCode($dragdropr); |
If I add to Grid B
1 2 3 4 5 6 7 |
$sort = <<< SORTABLE jQuery('#B .sortable-list').sortable({ connectWith: '#B .sortable-list', containment: '#B' }); SORTABLE; $grid->setJSCode($sort); |
I can now sort in grid B but can no longer drag and drop from B to C.
Any ideas please
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top