Forum
22:55
07/10/2014
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: ['Description'],
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 ...
16:56
Moderators
30/10/2007
Hello,
Â
1. afterInsertRow is not your solution.
2. afterSubmit as you set is not a grid parameter.
3. You use inlineedit - I suggest you to use aftersavefunc which should be passes as parameter in editRow.
See docs for this purpose.
Â
Kind Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
65 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66