Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
add baseLinkUrl option for link formatter
27/05/2010
06:57
Avatar
tim
Calgary Alberta Canada
Member
Members
Forum Posts: 61
Member Since:
04/11/2009
sp_UserOfflineSmall Offline

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

27/05/2010
08:44
Avatar
tim
Calgary Alberta Canada
Member
Members
Forum Posts: 61
Member Since:
04/11/2009
sp_UserOfflineSmall Offline

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); } };

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
65 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information