Hi
Need some help please
I am using a multiselect jqgrid with onSelectRow, onSelectAll and gridComplete event. My issue is when i check selectall check box which is selecting all the rows in the grid view but as soon as the gridComplete is called selectall check box is getting unchecked and i am not able to unselect all the rows.
Please let me know if some thing i need to take care here. below is my code
$(“#”+tableID).jqGrid({
datastr: wellboresData,
datatype:”jsonstring”,
colNames:['id','Well Legal Name','Wellbore Legal Name', 'Region', 'Country','State','Kick-off Latitude','Kick-off Longitude','Bottom Hole Latitude','Bottom Hole Longitude'],
colModel:[
{name:'id', width:100,hidden: true, align:”left”, key:true},
{name:'wellLegalName', width:”15%”, align:”left”},
{name:'wellboreLegalName', width:”10%”, align:”left”},
{name:'region', width:”15%”, align:”left”,sortable:true, jsonmap: “location.region”},
{name:'country', width:”15%”, align:”left”,sortable:true, jsonmap: “location.country”},
{name:'state', width:”10%”, align:”left”,sortable:true, jsonmap: “location.state”},
{name:'kolat', width:”10%”, align:”right”,sortable:true, sorttype:”float”, jsonmap: “location.koCoord.latitude”},
{name:'kolong', width:”10%”, align:”right”,sortable:true, sorttype:”float”, jsonmap: “location.koCoord.longitude”},
{name:'bhlat', width:”10%”, align:”right”,sortable:true, sorttype:”float”, jsonmap: “location.bhCoord.latitude”},
{name:'bhlong', width:”10%”, align:”right”,sortable:true, sorttype:”float”, jsonmap: “location.bhCoord.longitude”}
],
rowNum:20,
rowList:[5,10,20,50,100,200,500],
pager: '#'+pagerID,
sortname: 'id',
sortorder: “desc”,
multiselect: true,
caption: “Wellbore List”,
width:width,
height:”100%”,
shrinkToFit:true,
jsonReader:{
repeatitems:false,
id:”Id”,
root: function(wellboresData){return wellboresData;},
page: function(wellboresData){return 1;},
total: function(wellboresData){return 1;},
records: function(wellboresData){return wellboresData.length;}
},
onSelectRow: function(rowid,status){
if(status){
if (gridwellboreContext != null) {
if($.inArray(rowid,gridwellboreContext) === -1){
gridwellboreContext.push(rowid);
}
} else{
gridwellboreContext.push(rowid);
}
}else{
if($.inArray(rowid,gridwellboreContext) > -1){
gridwellboreContext.splice($.inArray(rowid,gridwellboreContext),1);
}
}
$(“#”+tableID).data(“modified”, true);
},
onSelectAll: function(aRowids,status){
if(status){
for(var i=0; i if (gridwellboreContext != null) { if($.inArray(aRowids,gridwellboreContext) === -1){ gridwellboreContext.push(aRowids); } } else{ gridwellboreContext.push(aRowids); } } }else{ for(var i=0; i if($.inArray(aRowids,gridwellboreContext) > -1){ gridwellboreContext.splice($.inArray(aRowids,gridwellboreContext),1); } } } $(“#”+tableID).data(“modified”, true); }, gridComplete: function(){ if (gridwellboreContext != null) { $.each(gridwellboreContext, function (e, wellboreId) { $(“#”+tableID).jqGrid('setSelection',wellboreId); }); } } }); $(“#”+tableID).jqGrid('navGrid','#'+pagerID, {edit:false,add:false,del:false}, {}, {}, {}, {multipleSearch:true, multipleGroup:true} );
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top