Forum


21:48

20/08/2009

I want Edit and Delete icons in each row of the grid. I have this working when the data is returned from MySQL using json but not when the data is in a clientside array. Using the loadComplete method, nothing displays in the 'Actions' column. Creating the icons in the relevant column in each line of the array displays the icons correctly but halts the programme and does nothing when they are clicked on. Code as follows:-
jQuery(document).ready(function(){
jQuery("#trlist").jqGrid({
datatype: 'clientSide',
colNames:['Actions','Row','Date', 'Acc to Dr','Acc to Cr','Reference','Amount','Tax','Description'],
colModel :[
{name:'act',index:'act', width:50,sortable:false},
{name:'id',index:'id', key:true, width:55, sorttype:'int'},
{name:'ddate',index:'ddate', width:90, sorttype:'date', datefmt:'d-m-Y'},
{name:'acc2dr',index:'acc2dr', width:180,sortable:false},
{name:'acc2cr',index:'acc2cr', width:180,sortable:false},
{name:'ref',index:'ref', width:70},
{name:'amount',index:'amount', width:60,align:'right',sortable:false},
{name:'tax',index:'tax', width:60,align:'right', sortable:false},
{name:'descript',index:'descript', width:180, sortable:false}
],
pager: jQuery('#trpager'),
rowNum:10,
viewrecords: true,
imgpath: '../includes/jqgrid/themes/coffee/images'
});
});
Code here populates the required variables, then:-
l_id++;
var be = '<img src="../images/edit.png" title="Edit" onclick="javascript:edittr('+l_id+')" >';
var se = '<img src="../images/delete.png" title="Delete" onclick="javascript:deltr('+l_id+')" >';
var line2add = {
act: be+' '+se,
id: l_id,
ddate: ddate,
acc2dr: a2dr,
acc2cr: a2cr,
ref: reference,
amount: amount,
tax: tax,
descript: description}
jQuery("#trlist").addRowData(l_id,line2add,"first");
The rest of each row in the grid looks fine. I would appreciate any assistance on this.
Most Users Ever Online: 715
Currently Online:
46 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