<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: How about a 'Route/restful' showlink</title>
	<link>http://www.trirand.com/blog/?page_id=393/feature-request/how-about-a-routerestful-showlink</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/feature-request/how-about-a-routerestful-showlink/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on How about a 'Route/restful' showlink</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/how-about-a-routerestful-showlink#p27557</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/how-about-a-routerestful-showlink#p27557</guid>
        	        	<description><![CDATA[<p>Hello,</p>
</p>
<p>Thank you very much for the code.</p>
<p>Instead I will not add this.</p>
<p>You can look at showLink as somthing like base formatter.</p>
<p>If you want something special it is better to add your own <a href="/jqgridwiki/doku.php?id=wiki:custom_formatter&#38;s[]=custom&#38;s[]=formatter" target="_blank">custom formatter</a>,</p>
<p>which get the code from showLink Formatter.</p>
</p>
<p>Regards</p>
]]></description>
        	        	<pubDate>Wed, 17 Oct 2012 09:57:29 +0300</pubDate>
        </item>
        <item>
        	<title>byterock on How about a 'Route/restful' showlink</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/how-about-a-routerestful-showlink#p27554</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/how-about-a-routerestful-showlink#p27554</guid>
        	        	<description><![CDATA[<p>I have been working with &#39;restful&#39; web servers and services for a while now and I have a simple patch to the &#39;showlink&#39; formatter code that allows me to create &#39;restful&#39;&#160; urls rather than ones based on the query string</p>
<p>for example I want</p>
<p><span style="text-decoration: underline;"><span style="color: #000000;">localhost:8080/</span></span><a href="http://www.asite.com/project/11/task/22/get" target="_blank"><span style="color: #000000;">project/1/task/22/get</span></a></p>
</p>
<p>so in my data I change the id of the row to &#39;11/task/22&#39; then I have this in the formater</p>
</p>
<p>&#160;&#160;&#160; {name: &#39;label&#39;, index: &#39;label&#39;,&#160; formatter:&#39;showlink&#39;, formatoptions:{baseLinkUrl:&#39;/project/&#39;, Restful: &#39;get&#39; } },<br />&#160;&#160;&#160;&#160;</p>
<p>any one else find this useful??</p>
</p>
<p>here is the change</p>
</p>
<p>$.fn.fmatter.showlink = function(cellval, opts) {<br />&#8211;&#160;&#160;var op = { baseLinkUrl: opts.baseLinkUrl,showAction:opts.showAction, addParam: opts.addParam &#124;&#124; "", target: opts.target,&#160;&#160;&#160; idName: opts.idName},</p>
<p>++&#160;&#160;var op = {restful: opts.restful, baseLinkUrl: opts.baseLinkUrl,showAction:opts.showAction, addParam: opts.addParam &#124;&#124; "", target: opts.target, idName: opts.idName},</p>
<p>&#160;&#160;target = "", idUrl;<br />&#160;&#160;if(!$.fmatter.isUndefined(opts.colModel.formatoptions)) {<br />&#160;&#160;&#160;op = $.extend({},op,opts.colModel.formatoptions);<br />&#160;&#160;}<br />&#160;&#160;if(op.target) {target = &#39;target=&#39; + op.target;}<br />++&#160;&#160;if (op.restful) {<br />++&#160;&#160;&#160;&#160; idUrl = op.baseLinkUrl+opts.rowId+&#39;/&#39;+op.restful;&#160;&#160;<br />++&#160;&#160;}&#160;else {<br />&#160; &#160;&#160;&#160; idUrl = op.baseLinkUrl+op.showAction + &#39;?&#39;+ op.idName+&#39;=&#39;+opts.rowId+op.addParam;<br />++&#160;&#160;&#160;}<br />&#160;&#160;if($.fmatter.isString(cellval) &#124;&#124; $.fmatter.isNumber(cellval)) {&#160;//add this one even if its blank string<br />&#160;&#160;&#160;return "&#60;a "+target+" href="" + idUrl + ""&#62;" + cellval + "&#60;/a&#62;";<br />&#160;&#160;}else {<br />&#160;&#160;&#160;return $.fn.fmatter.defaultFormat(cellval,opts);<br />&#160;&#160;}<br />&#160;};</p>
]]></description>
        	        	<pubDate>Wed, 17 Oct 2012 04:36:02 +0300</pubDate>
        </item>
</channel>
</rss>