JqGrid drag and drop receive event

I use jqgrid drag and drop, I have two tables TABLE A and TABLE B, I draw one row from TABLE A and Droping to TABLE B, I want to capture a new row identifier and the data received in the table, there is any receive event in jqGrid ?

+3
jqgrid
May 18 '10 at 11:58 a.m.
source share
2 answers

You can define the function of the ondrop event (see link ) as shown below

 jQuery("#table2").jqGrid('gridDnD', { ondrop: function (ev, ui, getdata) { // var acceptId = $(ui.draggable).attr("id"); // getdata is the data from $('#table1').jqGrid('getRowData',acceptId); // so you have full information about dropped row } }); 

inside the ondrop parameters you will find all the necessary information.

+5
May 18 '10 at 15:00
source share
 $("#gbox_destinationTable tr td").droppable({ drop : function(event, ui) { var draggedHtml = ui.draggable.html(); $(this).append(draggedHtml); deleteFromSource(ui.draggable.parent()); } }); function deleteFromSource(draggedObj) { $('#sourceTable').jqGrid('delRowData', draggedObj.attr('id')); } 

You can see the full example for a specific jqgrid implementation: http://jsfiddle.net/pragya91/fzkqxdxm/

+1
Nov 30 '15 at 15:22
source share



All Articles