Forum
04:43
10/09/2009
Hi Tony,
first I'm impressed about the time you need to fix bugs. Today I noticed an behaviour with the jQuery ajax complete event. If I edit a row and the data had been send to server, the global jQuery ajax complete event hadn't been triggered.
Here is an example:
I configure an global complete event for jQuery ajax:
url: 'index.php',
type: “POST”,
beforeSend: myBeforeSendFn,
complete: myCompleteFn,
error: myErrorFn
});
Than I configure the grid (I shortened the setup for example purposes):
$GridTbl = $('#gridTbl');
$GridTbl.jqGrid({
url: 'index.php',
editurl: 'index.php?pageId=1019',
colNames: ['Id', 'Description', 'Sum'],
colModel: [{name:'rowid', hidden: true},
{name:'description', editable: true},
{name:'costsum', editable: true, width: 80, align: 'right', formatter: 'currency'}],
onSelectRow: function (id) {
if(id && id!==lastSel){
$GridTbl.restoreRow(lastSel);
lastSel=id;
}
$GridTbl.editRow(id,
true,
null,
function (e) {
// ******** BUG-BEHAVIOUR ********
// Because of the bug I have to trigger
// the global ajax complete event manually
myCompleteFn ();
// Other code …
},
null,
{'saveRow': true},
null, null,
function (rowid) {
alert (”There was an error with row ” + rowid);
}
);
}
});
After that I edit a row and hit enter to save the data. The server request had been completed but the “myCompleteFn” function hadn't been triggered. Maybe I misunderstand the functionality?
08:01
Moderators
30/10/2007
Hello,
I do not think that this is a bug. Think a little.
You have a global setup for ajax- complete, but this complete event is then overwriten by the particular one in saveRow method.
Please read this
http://docs.jquery.com/Ajax/jQ.....up#options
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