Hi,
Â
I am new to jqgrid, i have a jqgrid which populates data,one of the column in that grid has drop down for each and every row where user can update the data and click on enter it will save in the database.
only two options in the dropdown one is present and another is unpresent
The idea is that – the record which is updated to unpresent it has to be in green color ( so that users can identify that the record is unpresent.)
 how can i use the below method in my code.
Â
afterInsertRow : function(rowid, rdata){
if(condition here) {
 $(â€#â€+rowid,â€#mygridâ€).css({‘background-image’:’url(../js/themes/basic/images/some_bg.jpg)’, color: ‘red’})
}
..
}
Â
here is my code
$(function() {
var lastSelectedId;
$(“#list”).jqGrid({
url: ‘JQGridHandler.ashx’,
datatype: ‘json’,
height: 250,
colNames: ,
colModel: [
{ name: ‘Desc’, index: ‘Desc’, width: 256, stype: ‘text’, sortable: false, editable: true, edittype: ‘select’, formatter: ‘select’, editoptions: { value: “present:Present; unpresent:unpresent”} },
],
rowNum: 10,
loadonce: true,
rowList: [10, 20, 30],
pager: ‘#pager’,
sortname: ‘name’,
viewrecords: true,
sortorder: ‘asc’,
gridview: true,
ignoreCase: true,
caseSensitive: false,
rownumbers: true,
reloadAfterSubmit: false,
width: 1024,
jsonReader: {
repeatitems: false
},
caption: ‘Update’,
editurl: ‘JQGridHandler.ashx’,
onSelectRow: function(id) {
if (id && id !== lastSelectedId) {
$(‘#list’).restoreRow(lastSelectedId);
$(‘#list’).editRow(id, true);
lastSelectedId = id;
}
},
afterSubmit: function() {
$(this).jqGrid(“setGridParam”, { datatype: ‘json’ });
return [true];
alert(“returnvalue”);
}
});
in ashx file we are calling a stored procedure where it updates the selection …
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top