I’m using jqGrid, and I add a checkbox column, I want to be able to get checked rows so I can call the server with them…
My jqGrid Code:
<script type="text/javascript">
$(function () {
$("#UsersGrid").jqGrid({
url: "Handler.ashx",
datatype: 'json',
height: '100%',
width: '500',
colNames: [' ', 'ref#', 'Module', 'TT#', 'AssignedOn', 'TrialNo'],
colModel: [
{ name: ' ', index: 'ChkBox', width: 16, sortable: false, editable: true, formatter: "checkbox", formatoptions: { disabled: false }, editable: true, edittype: "checkbox" },
{ name: 'ref#', width: 50, sortable: true },
{ name: 'Module', width: 50, sortable: true },
{ name: 'TT#', width: 110, sortable: true },
{ name: 'AssignedOn', width: 110, sortable: true },
{ name: 'TrialNo', width: 50, sortable: true }
],
rowNum: 10,
rowList: [10, 20, 30],
pager: '#UsersGridPager',
sortname: ' ',
viewrecords: true,
sortorder: 'asc'
//caption: "Cases"
});
$("#UsersGrid").jqGrid('navGrid', '#UsersGridPager', { edit: false, add: false, del: false });
</script>
Thanks in Advance…
You should better you multiselect:true, because the functionality i can see you are implementing with check boxes is to select multiple rows.
here’s how it will work for u.
1. Make multiselect:true in jqgrid Parameters.
button type=”button” value=”submit” id=”clickMe” >Submit /button> //start and close the tags properly.
$(‘#clickMe’).click(function(){
var selRowIds = $(‘#grid’).jqGrid(‘getGridParam’, ‘selarrrow’);
and your controller should look like this
I’m assuming you have dataType for all the columns as string and they all are editable:true(you can mention this with colModal. So if only Module, AppliedOn is editable true, so you can get only these two values in button click. depending upon your need you can change the code.