Forum


18:16

16/03/2010

I have this jqgrid, it shows the expected data. I only want the price to be editable, but when I click in the grid it doesn't change to edit mode as it should. Nothing happens infact.
can you help???
<script type="text/javascript">
var themeURL = '<%=AppHelper.themeImageUrl() %>';
var gridUr = '<%=ResolveUrl("~/Order/JsonAccessories" )%>';
jQuery("#Accessorylist").jqGrid({
url: gridUr,
datatype: 'json',
mtype: 'GET',
colNames: ['PartUID', 'FieldDesc', 'price'],
colModel: [
{ name: 'id', index: 'id', width: 100, align: 'left', editable: false, editrules: { edithidden: true }, hidden: true },
{ name: 'FieldDesc', index: 'Description', width: 300, align: 'left', editable:false },
{ name: 'price', index: 'Price', width: 200, align: 'left', editable: true }
],
pager: jQuery('#Accessorypager'),
rowNum: 10,
rowList: [5, 10, 20, 50],
sortname: 'Id',
sortorder: "desc",
viewrecords: true,
onSelectRow: function(id) {
if (id && id !== lastsel) {
jQuery('#Accessorylist').jqGrid('restoreRow', lastsel);
jQuery('#Accessorylist').jqGrid('editRow', id, true); lastsel = id;
}
},
imgpath: themeURL,
height: '250px'
});
jQuery("#Accessorylist").jqGrid('navGrid', "#Accessorylist", { edit: false, add: false, del: false });
</script>
13:30

Moderators
30/10/2007

Hello,
The first thing is to see if you have a correct id. Try this
....
onSelectRow: function(id) {
alert(id);
if (id && id !== lastsel) {
jQuery('#Accessorylist').jqGrid('restoreRow', lastsel);
jQuery('#Accessorylist').jqGrid('editRow', id, true); lastsel = id;
}
},
....
Second I do not see any definition for lastsel.
it is a good idea to define such variable before cretion of the grid something like
var lastsel;
$("#mygrid").jqGrid({...})
Regards
Tony
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:
69 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