I set the multiSelect property of my jqGrid to true. Now I would like to send data from particular columns in each row that was selected and add them all up and send them as a JSON string to a URL of my choosing when the garbage can icon is selected.
So I have just two questions; One how do I target the delete button (represented by the garbage can icon) using jQuery and two how do I get all the data from certain columns of each selected row and send all of them as JSON to a URL that I specify in the delete section of my jqGrid.
I know I can make use of the onSelectRow property but I’m still not too sure what needs to be done in this property. The script below will give me all Row data but I only want the ones that I selected:
jQuery(“#mygridid”).jqGrid(‘getRowData’)
Also I want to be able to grab the ID of the garbage can icon if it has one and use it like the following:
$(‘#garbageCanIcon’).click(function(){
//Do something
)}
Below is a snippet of my jqGrid code:
colNames: [‘EmpId’, ‘Name’],
colModel: [{ name:’EmpId’, index:’EmptId’},
{ name:’Name’, index:’Name’}
],
jsonReader: {
root: “rows”,
page: “page”,
total: “total”,
records: “records”,
repeatitems: false,
id: ‘CustId’
},
multiselect: true
}).navGrid(‘#jqControls’, { add: false, edit: true, del: true, search: true, refresh: true},onSelectRow:func(){
},
//Setting for edit
{
zIndex: 100,
closeOnEscape: true,
closeAfterEdit: true,
recreateForm: true,
width: ‘100%’,
height: ‘100%’,
editData: { name: “Yes” }
},
//setting for add
{}
,
//setting for delete
{
zIndex: 100,
closeOnEscape: true,
closeAfterDelete: true,
recreateForm: true,
url:’mycontroller/mycontrollermethod’
},
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top