<?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: custom formating of data provided by dataUrl</title>
	<link>http://www.trirand.com/blog/?page_id=393/feature-request/custom-formating-of-data-provided-by-dataurl</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/custom-formating-of-data-provided-by-dataurl/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on custom formating of data provided by dataUrl</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/custom-formating-of-data-provided-by-dataurl#p11611</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/custom-formating-of-data-provided-by-dataurl#p11611</guid>
        	        	<description><![CDATA[<p>Oleg,</p>
<p>Thanks . Fixed. Also removed new Date from data.</p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Fri, 06 Nov 2009 12:17:56 +0200</pubDate>
        </item>
        <item>
        	<title>OlegK on custom formating of data provided by dataUrl</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/custom-formating-of-data-provided-by-dataurl#p11568</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/custom-formating-of-data-provided-by-dataurl#p11568</guid>
        	        	<description><![CDATA[<p>Hi Tony,</p>
<p>I tested buildSelect feature only in the case of edittype: &#39;select&#39; and editoptions: { dataUrl:&#39;...&#39;, buildSelect: mybuildSelectFunction}. There is a small problem which can be easy fixed: mybuildSelectFunction will be called two times: first expected in line 326 of grid.common.js (var b = options.buildSelect(data);) and another time unexpected with 0 as data in the line 340 (jQuery(elem).attr(options);).</p>
<p>To fix the problem one can add, for example, after the line 326 (var b = options.buildSelect(data);) the following line:</p>
<p>&#160;&#160;&#160; try { delete options[&#39;buildSelect&#39;]; } catch (e) { }</p>
<p>Exactly like you do in the line 323:</p>
<p>&#160;&#160;&#160; try {delete options[&#39;dataUrl&#39;];delete options[&#39;value&#39;];} catch (e){}</p>
<p>Another small problem, that you add {nd:new Date().getTime()} as a "data" parameter of jQuery.ajax request (see line 321). It force executing jQuery.ajax in IE, but switch off response cashing (see <a href="http://www.trirand.com/blog/?page_id=393/bugs/no-caching-of-server-data-because-of-new-nd-property-in-prmnames&#038;value=sf%25members%251%25user1671&#038;search=2&#038;ret=all" rel="nofollow" target="_blank">http://www.trirand.com/blog/?page_id=393/bugs/no-caching-of-server-data-because-of-new-nd-property-in-prmnames&#038;value=sf%25members%251%25user1671&#038;search=2&#038;ret=all</a>). To fix the problem I had to use ajaxSelectOptions, which are seen in createEl() as ajaxso. It works now very good, but I am not sure, that setting ajaxSelectOptions: { data: ""} for $.jgrid.defaults is OK for all other places of ajaxSelectOptions usage.</p>
<p>After all such changes everything works perfectly. One more time thanks for the nice feature buildSelect.</p>
<p>Generally I see buildSelect function as a custom deserialization after an ajax request. Version 3.6 has not serialisation for all $.ajax calls. Do you think to implement also custom deserialization? For example, if jqGrid will provide not only serializeGridData, serializeRowData, serializeEditData etc. functions, but also deserializeGridData etc. which convert <span lang="EN-US">responseText to format needed for jqGrid, then one could be able fill </span><span lang="EN-US">jqGrid </span><span lang="EN-US">with data not prepared specially for </span><span lang="EN-US">jqGrid. For example, one can call Amazon of twitter services and fill </span><span lang="EN-US">jqGrid</span><span lang="EN-US"> with the response data. Is it not interesting?<br /></span></p>
</p>
<p>Best regards</p>
<p>Oleg</p>
]]></description>
        	        	<pubDate>Thu, 05 Nov 2009 16:08:56 +0200</pubDate>
        </item>
        <item>
        	<title>tony on custom formating of data provided by dataUrl</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/custom-formating-of-data-provided-by-dataurl#p11550</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/custom-formating-of-data-provided-by-dataurl#p11550</guid>
        	        	<description><![CDATA[<p>Oleg,</p>
<p>Could you please test the 3.6RC - there is a event buildSelect, which can be used for this purpose. Also available in editoptions and searchoptions. I have updated the documentation for this. Please let me know if it work OK for you.</p>
<p>Thanks</p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Thu, 05 Nov 2009 09:40:05 +0200</pubDate>
        </item>
        <item>
        	<title>OlegK on custom formating of data provided by dataUrl</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/custom-formating-of-data-provided-by-dataurl#p11382</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/custom-formating-of-data-provided-by-dataurl#p11382</guid>
        	        	<description><![CDATA[<p>Thank you very much, Tonny!</p>
</p>
<p>Oleg</p>
]]></description>
        	        	<pubDate>Mon, 02 Nov 2009 04:41:53 +0200</pubDate>
        </item>
        <item>
        	<title>tony on custom formating of data provided by dataUrl</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/custom-formating-of-data-provided-by-dataurl#p11381</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/custom-formating-of-data-provided-by-dataurl#p11381</guid>
        	        	<description><![CDATA[<p>Hello Oleg,</p>
<p>I see this. Ok. Will do it for the select - a callback wich can be used whitin the complete to accept diffrent formats from server&#160; and construc the select. Little difficult to do it for the searchGrid selects, but..</p>
<p>Best</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Mon, 02 Nov 2009 04:34:01 +0200</pubDate>
        </item>
        <item>
        	<title>OlegK on custom formating of data provided by dataUrl</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/custom-formating-of-data-provided-by-dataurl#p11367</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/custom-formating-of-data-provided-by-dataurl#p11367</guid>
        	        	<description><![CDATA[<p class="MsoNormal"><span lang="EN-US">Hello Tonny,</span></p>
<p class="MsoNormal"><span lang="EN-US">you are right of cause, that one could overwrite </span><span style="font-size: 10pt; line-height: 115%; font-family: &#34;Courier New&#34;;">complete</span><span lang="EN-US"> function in all </span><span style="font-size: 10pt; line-height: 115%; font-family: &#34;Courier New&#34;;">$.ajax</span><span lang="EN-US"> requests with respect of </span><span style="font-size: 10pt; line-height: 115%; font-family: &#34;Courier New&#34;;">$.jgrid.ajaxOptions, ajaxEditOptions</span><span lang="EN-US"> or </span><span style="font-size: 10pt; line-height: 115%; font-family: &#34;Courier New&#34;;">ajaxso</span><span lang="EN-US"> parameters. But on the other side if somebody does so, he&#8217;ll receive problem of using internal jqGrid structures. In </span><span style="font-size: 10pt; line-height: 115%; font-family: &#34;Courier New&#34;;">complete</span><span lang="EN-US"> function inside of </span><span style="font-size: 10pt; line-height: 115%; font-family: &#34;Courier New&#34;;">createEl</span><span lang="EN-US"> in <em>grid.common.js</em> for example one needs use </span><span style="font-size: 10pt; line-height: 115%; font-family: &#34;Courier New&#34;;">options</span><span lang="EN-US"> and other variable in the scope. </span></p>
<p class="MsoNormal"><span lang="EN-US">The main idea of my suggestion is very easy. With respect of custom serialization/deserialization functions one could change paradigm of jqGrid usage on the side of backend services. Currently one has to provide on the backend server services providing data for jqGrid in a special format prepared for jqGrid. If you allow to use custom serialization and destabilization functions, if would be possible use many <strong><span style="text-decoration: underline;">existing backend services</span></strong> and convert data for jqGrid before and after $.ajax requests. The conversion can de done on the client side, without any additional requirement to the backend! It could be important for lot of scenarios of jqGrid usage.</span></p>
<p class="MsoNormal"><span lang="EN-US">Functions </span><span style="font-size: 10pt; line-height: 115%; font-family: &#34;Courier New&#34;;">serializeGridData, serializeRowData, serializeEditData</span><span lang="EN-US"> from v.3.6 provide serialization, but I found no deserialization functions. There are exists also </span><span style="font-size: 10pt; line-height: 115%; font-family: &#34;Courier New&#34;;">errorfunc,<span style="color: green;"> </span>errorTextFormat</span><span lang="EN-US">, which are very useful for decode error messages provided by server.</span></p>
<p class="MsoNormal"><span lang="EN-US">Why not provide functions like de</span><span style="font-size: 10pt; line-height: 115%; font-family: &#34;Courier New&#34;;">serializeGridData</span><span lang="EN-US"> etc., which could convert data send from server (responseText) to format needed for jqGrid? For example, for conversion from JSON format to HTML fragment (&#60;select&#62;&#8230;&#60;/select&#62;) like in the case of <strong>dataUrl</strong>?</span></p>
<p class="MsoNormal"><span lang="EN-US">Best regards</span></p>
<p class="MsoNormal"><span lang="EN-US">Oleg</span></p></p>
]]></description>
        	        	<pubDate>Sun, 01 Nov 2009 14:29:38 +0200</pubDate>
        </item>
        <item>
        	<title>tony on custom formating of data provided by dataUrl</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/custom-formating-of-data-provided-by-dataurl#p11358</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/custom-formating-of-data-provided-by-dataurl#p11358</guid>
        	        	<description><![CDATA[<p>Hello Oleg,</p>
<p>I think that this is not needed. If you see a little below into the code you will see the following</p>
<p>jQuery.ajax(jQuery.extend({<br />&#160;&#160;&#160; &#160; url: options.dataUrl,</p>
<p>&#160;&#160;&#160;&#160;&#160; complete : function(res, status) {</p>
<p>&#160;&#160;&#160;&#160; ..............</p>
<p>&#160;&#160;&#160;&#160; }</p>
<p>&#160;&#160;&#160;&#160;&#160; .....</p>
<p><strong>},ajaxso &#124;&#124; {}));</strong></p>
<p>As can be seen, the complete function can be overwritten with your own using the ajaxso options. I will try to document this today.</p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Sun, 01 Nov 2009 01:26:43 +0200</pubDate>
        </item>
        <item>
        	<title>OlegK on custom formating of data provided by dataUrl</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/custom-formating-of-data-provided-by-dataurl#p11356</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/custom-formating-of-data-provided-by-dataurl#p11356</guid>
        	        	<description><![CDATA[<p class="MsoNormal"><span lang="EN-US">Hello Tonny!</span></p>
<p class="MsoNormal"><span lang="EN-US">There is a nice feature in jqGrid, which I cannot currently use: <strong>dataUrl</strong>.</span></p>
<p class="MsoNormal"><span lang="EN-US">My problem is that because of architecture design and some implementation problem I cannot easy give back HTML fragments required for <strong>dataUrl</strong>. But I can very easy provide the same information as a JSON data.</span></p>
<p class="MsoNormal" style="margin-bottom: 6pt;"><span lang="EN-US">In grid.common.js in the </span><span style="font-size: 10pt; line-height: 115%; font-family: &#34;Courier New&#34;;">complete</span><span> <span lang="EN-US">function after </span></span><span style="font-size: 10pt; line-height: 115%; font-family: &#34;Courier New&#34;;">jQuery.ajax</span><span lang="EN-US"> request (line 318) the response data of </span><span style="font-size: 10pt; line-height: 115%; font-family: &#34;Courier New&#34;;">data.responseText</span><span lang="EN-US"> are waiting in the form </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: &#34;Courier New&#34;;">&#60;<a href="http://december.com/html/4/element/select.html" target="_blank"><span style="color: blue;">select</span></a>&#62; </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: &#34;Courier New&#34;;">&#60;<a href="http://december.com/html/4/element/option.html" target="_blank"><span style="color: blue;">option</span></a> value=&#39;1&#39;&#62;One&#60;/<a href="http://december.com/html/4/element/option.html" target="_blank"><span style="color: blue;">option</span></a>&#62; </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: &#34;Courier New&#34;;">&#60;<a href="http://december.com/html/4/element/option.html" target="_blank"><span style="color: blue;">option</span></a> value=&#39;2&#39;&#62;Two&#60;/<a href="http://december.com/html/4/element/option.html" target="_blank"><span style="color: blue;">option</span></a>&#62; </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: &#34;Courier New&#34;;">&#8230;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: &#34;Courier New&#34;;">&#60;/<a href="http://december.com/html/4/element/select.html" target="_blank"><span style="color: blue;">select</span></a>&#62;</span></p>
<p class="MsoNormal" style="margin-top: 6pt;"><span lang="EN-US">and will be directly used as</span></p>
<p class="MsoNormal" style="margin-top: 6pt;"><span lang="EN-US"><span>&#160;</span></span><span style="font-size: 10pt; line-height: 115%; font-family: &#34;Courier New&#34;; color: blue;">var</span><span style="font-size: 10pt; line-height: 115%; font-family: &#34;Courier New&#34;;"> a = jQuery(data.responseText).html();</span></p>
<p class="MsoNormal" style="margin-top: 6pt;"><span lang="EN-US">It would be nice to include an additional function like customDecode(</span><span style="font-size: 10pt; line-height: 115%; font-family: &#34;Courier New&#34;;">responseText</span><span lang="EN-US">), which could be defined in the </span><span style="font-size: 10pt; line-height: 115%; font-family: &#34;Courier New&#34;;">editoptions</span><span> <span lang="EN-US">together with <strong>dataUrl</strong>. CustomDecode function could convert the response text in the </span></span><span style="font-size: 10pt; line-height: 115%; font-family: &#34;Courier New&#34;;">&#60;<a href="http://december.com/html/4/element/select.html" target="_blank"><span style="color: blue;">select</span></a>&#62;&#8230;&#60;/<a href="http://december.com/html/4/element/select.html" target="_blank"><span style="color: blue;">select</span></a>&#62;</span><span lang="EN-US"> form or in any another form, which better for using in jqGrid.</span></p>
<p class="MsoNormal"><span lang="EN-US">It will be very small change in the code of jqGrid, but it will be makes more flexibility in usage of jqGrid. Such changes seems to me very close another features implemented in jqGrid 3.6.</span></p>
<p class="MsoNormal"><span lang="EN-US">&#160;</span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; font-family: &#34;Calibri&#34;,&#34;sans-serif&#34;;">Oleg</span></p></p>
]]></description>
        	        	<pubDate>Sat, 31 Oct 2009 17:26:23 +0200</pubDate>
        </item>
</channel>
</rss>