Forum


20:40

11/12/2009

I am opening a jquery dialog with a jqGrid and initially populating
the grid with data from my controller. This works fine.
I cannot use a pager with my grid, rather I have add and delete buttons
in a bar at the top of the grid.
Can someone point me to a grid example which includes code for
adding empty rows, editing those rows, deleting rows and saving
everything to the database in one transaction.
In my save function, I know how to gather information from the
grid and send it to my controller. I'm most interested in the adding and editing
function, plus how to identify those rows deleted from the grid.
Thanks.
22:34

11/12/2009

Hello:
I have added functionality to add, change and delete rows in the jqGrid in my jQuery dialog.
However, using the getChangedCells method continually returns an empty array. Please
take a look at my grid and tell me what I am missing. Thanks.
// Repairs grid definition.
$(”#repairsGrid”).jqGrid({
url:”../Controllers/GridController.aspx”,
datatype: 'json',
mtype: 'GET',
colNames:columnNames,
colModel:columnModel,
sortname: 'status',
jsonReader: {
root: “rows”,
page: “page”,
total: “total”,
records: “records”,
repeatitems:
false
,
id: “tir_tir_key”
},
rowNum:10,
rowList:[10,20,30],
loadonce:
true
,
loadui: “disable”,
viewrecords:
true
,
multiselect:
false
,
pgbuttons:
false
,
pgtext: “”,
altRows:
true
,
height: 200,
width: 550,
shrinkToFit:
true
,
caption: “Repairs”,
imgpath: imgPath,
onSelectRow: onSelectRowGrid,
cellEdit:
false
,
cellsubmit: 'clientArray',
editurl: “server.aspx”,
gridComplete:
function
(){
var
ids = jQuery(”#repairsGrid”).jqGrid('getDataIDs');
for(var
i=0;i < ids.length;i++){
var
cl = ids[i];
de = “<input style='height:22px;width:25px;' type='button' value='Del' onclick=\\”jQuery('#repairsGrid').delRowData('”+cl+”');\\” />”;
jQuery(”#repairsGrid”).jqGrid('setRowData',ids[i],{act:de});
}
}
});
// eof repairsGrid definition
12:37

Moderators
30/10/2007

Hello,
The getCahngedCells is able to work only in celEdit mode. It appears that you use inline editing, where this method is not applicable.
Best 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:
60 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