Forum


06:07

04/11/2009

I know the first response I will get will be -> "use setColProp in formatCell event".
But I've been down that road and back again. setColProp is just too buggy and has too many side-effects for me to use reliably.
I've read almost every post on this forum and I've seen a half a dozen posts with users asking how to accomplish this, normally 'setColProp' is the only work-around.
Is there anyone that has been able to do this and can help?
I really just need to append the rowId:
colModel [...
editoptions:{dataUrl:'myurl?rowId='+rowid,....
....]
Thanks
tim
20:09

Moderators
30/10/2007

Hello,
var myurl = 'myurl?rowId='+rowid;
$("#grid").jqGrid('setColProp','mycol',{editoptions:{dataUrl:myurl}});
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.
20:22

04/11/2009

Hi Tony,
I realize you're pretty busy, but if you could please look into this a little further.
There are 2 issues with setColProp (I have to use it with formatCell to support dynamic selectboxes) :
1. tabbing does not support the correct event sequences as posted here:
http://www.trirand.com/blog/?p.....bing-over/
2. When using formatCell with setColProp, pre-existing editoptions are lost – they do not work (example add 'size: 14' to the colModels editoptions, and you'll discover formatCell kills it.)
This is a real problem. I would rather have the column model editoptions dataUrl support post data, and I think doing this would benefit everyone for other things, but I could live with any solution that has no bugs.
Please and Thanks,
tim
02:46

04/11/2009

06:18

04/11/2009

Tony,
My js skills are non-existent so I will not even think about checking anything in github, but here's somethin to think about:
- function createEl(eltype,options,vl,autowidth, ajaxso) {
+ function createEl(rowid,eltype,options,vl,autowidth, ajaxso) {
grid.common.js : line 319
- url: options.dataUrl,
+ url: options.dataUrl+'&rowId='+rowid,
// may want to pass a variable into define the rowId arg name
// handle '?' vs. '&' … dependant upon url? – all mine will not require it
grid.celledit.js : line 75
- var elc = createEl($t.p.colModel[iCol].edittype,opt,tmp,true,$.extend({},$.jgrid.ajaxOptions,$t.p.ajaxSelectOptions || {});
+ var elc = createEl($t.rows[iRow].id,$t.p.colModel[iCol].edittype,opt,tmp,true,$.extend({},$.jgrid.ajaxOptions,$t.p.ajaxSelectOptions || {});
grid.inlineedit.js : line 41
- var elc = createEl(cm[i].edittype,opt,tmp,true,$.extend({},$.jgrid.ajaxOptions,$t.p.ajaxSelectOptions || {}));
+ var elc = createEl(rowid,cm[i].edittype,opt,tmp,true,$.extend({},$.jgrid.ajaxOptions,$t.p.ajaxSelectOptions || {}));
grid.formedit.js : line 738
- elc = createEl(this.edittype,opt,tmp,false,$.extend({},$.jgrid.ajaxOptions,obj.p.ajaxSelectOptions || {}));
+ elc = createEl(rowid,this.edittype,opt,tmp,false,$.extend({},$.jgrid.ajaxOptions,obj.p.ajaxSelectOptions || {}));
tim
Most Users Ever Online: 715
Currently Online:
150 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