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.edittype,opt,tmp,true,$.extend({},$.jgrid.ajaxOptions,$t.p.ajaxSelectOptions || {}));
+ var elc = createEl(rowid,cm.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
nevermind (obviously a hack since it will ignore showAction with appendCell, but it does the trick):
$.fn.fmatter.showlink = function(cellval, opts) {var op = {baseLinkUrl: opts.baseLinkUrl,showAction:opts.showAction, addParam: opts.addParam || “”, target: opts.target, appendCell:opts.appendCell, idName: opts.idName }, target = “”, idUrl; afterUrl = “”; if(!isUndefined(opts.colModel.formatoptions)) { op = $.extend({},op,opts.colModel.formatoptions); } if(op.target) {target = 'target=' + op.target;} if(op.appendCell){afterUrl=cellval;}else{afterUrl=op.showAction+'?'+op.idName+'='+opts.rowId;} idUrl = op.baseLinkUrl+afterUrl+op.addParam; if(isString(cellval)) { //add this one even if its blank string return “” + cellval + ““; }else { return $.fn.fmatter.defaultFormat(cellval,opts); } };
bump…..
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
OK this is still a problem.
Moving my dataUrl from the setColProp directly to the editoptions fixed the 'tabbing' issue, but editoptions does not allow me to append the currently selected rowid.
Tony did you get a chance to look at this?Any feedback?
Please and Thanks,
Tim
This is no longer a problem for me, I stopped using 'setColProp' and went to straight to editoptions.
I will leave the example up for a bit, since I still think it's a bug that should be fixed.
Also, I have noticed that using
Well, I'm a little confused.
Originally you said: “the JQGrid doesn't return me nothing”. Now you're saying “when i search some information returns me both”?
At any rate,
Using Firebug, go to the URL that is meant to return your data.
Is it returning data? How does the data look (good or malformed)?
tim
Hi Tony…. I created a link to the problem:
http://blackstag.com/jqDemo/de…..;PAGE.html
Some how the event's are not working between the mousclicking over and tabbing over.
Note that the example post twice to the server, once is the onchange event and the other is the standard submitcell event… (The reason I need 2 post events is for chaining selectboxes. Although this example does not show it – the onchange event posts the change, so the second selectbox gets the update when mouseclicking over).
Also here are some screen shots:
Picture 1. Mouseclicking the next cell over.
OK I found the problem:
http://blackstag.com/jqDemo/de…..;PAGE.html
Do the following with the above example:
1. Open the searchBar using the navbutton.
2. Run a filter: say put 'F' into the caption column then hit enter!
3. Open the MultiSearch dialog by clicking the very first nav button.
4. Close the MultiSearch dialog.
5. hit the reload navbutton.
Notice it cleared the filterbar, but did not reload the grid data.
6. Hit the reload button again.
Now the all the data loads.
This is a bug right?
Thanks
tim
That will do just fine.
Thanks Tony.
tim
I would suggest you create a custom button:
http://www.trirand.com/jqgridw…..om_buttons
1. you can use the pre-submit events to store global variables holding the rowid and the cellvalue (your userid).
2. then have a custom button function that triggers an ajax post:
example….
|
1 |
.jqGrid('navButtonAdd','#jQGridpager',{buttonicon:'ui-icon-wrench',<br /> onClickButton:function(){$.post('my-delete-url?rowid=therow&user=userid');},caption:'Delete!'});<br /> |
[edit: if your post already works then just read #1 and store the cellvalue in a variable]
tim
A good starting point would be to look at a similar example; check out the demo page:
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top