Forum
06:57
04/11/2009
Would be nice not to have to define custom formatters all the time.
I would like the option to do:
formatter: 'link'
formatoptions: {'baseLinkUrl': 'http://externalUrl/service?ite.....='}
that would generate an href like http://externalUrl/service?ite.....ycellvalue, with format/un-format handling built in.
Or optionally have an option for 'showlink' that inserts cellvalue just after the baseLinkUrl
ie
formatter: 'showlink'
formatoptions: {'baseLinkUrl': 'http://externalUrl/service?ite.....=', insertCellval:true}
Please and Thanks,
tim
08:44
04/11/2009
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); } };
Most Users Ever Online: 715
Currently Online:
88 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