<?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 formatter with xmlstring will not work</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/custom-formatter-with-xmlstring-will-not-work</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/help/custom-formatter-with-xmlstring-will-not-work/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>woron on custom formatter with xmlstring will not work</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-formatter-with-xmlstring-will-not-work#p29140</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-formatter-with-xmlstring-will-not-work#p29140</guid>
        	        	<description><![CDATA[<p>ok, Im found the soluion <img class="spSmiley" style="margin:0" title="Laugh" src="/blog/wp-content/forum-smileys/sf-laugh.gif" alt="Laugh" /></p>
<p>After convert the xmlstring from currently row to object, can search for currency!</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4585' value='Select Code' data-codeid='sfcode4585' /></p>
<div class='sfcode' id='sfcode4585'>formatter: function (cellvalue, options, rowObject) {<br />&#160;&#160; &#160;var xml = rowObject.xml,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;xmlDoc = $.parseXML( xml ),<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;$xml = $( xmlDoc ),<br />&#160;&#160; &#160;$currency = $xml.find( &#34;currency&#34; );<br />&#160;&#160; &#160;return cellvalue + &#39; &#39; + $currency.text()<br />}</div>
<p>thank you all</p>
]]></description>
        	        	<pubDate>Wed, 10 Jul 2013 14:48:00 +0300</pubDate>
        </item>
        <item>
        	<title>woron on custom formatter with xmlstring will not work</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-formatter-with-xmlstring-will-not-work#p29139</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-formatter-with-xmlstring-will-not-work#p29139</guid>
        	        	<description><![CDATA[<p>I would like the currency is displayed in the cell with price.<br />But the formatter has no access to the XML data with rowObject.</p>
<p>Hat anyone have any idea what it may be?</p>
<p>Here is a complete example code:</p>
<p>
&#60;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&#62;<br />&#60;html xmlns="http://www.w3.org/1999/xhtml"&#62;<br />&#60;head&#62;<br />&#160;&#160;&#160; &#60;title&#62;&#60;/title&#62;<br />&#160;&#160;&#160; &#60;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&#62;</p>
<p>&#160;&#160;&#160; &#60;link rel="stylesheet" type="text/css" href="http://www.trirand.com/blog/jqgrid/themes/redmond/jquery-ui-custom.css" /&#62;<br />&#160;&#160;&#160; &#60;link rel="stylesheet" type="text/css" href="http://www.trirand.com/blog/jqgrid/themes/ui.jqgrid.css" /&#62;<br />&#160;&#160;&#160; &#60;script type="text/javascript" src="http://www.trirand.com/blog/jqgrid/js/jquery.js"&#62;&#60;/script&#62;<br />&#160;&#160;&#160; &#60;script type="text/javascript" src="http://www.trirand.com/blog/jqgrid/js/jquery-ui-custom.min.js"&#62;&#60;/script&#62;<br />&#160;&#160;&#160; &#60;script type="text/javascript" src="http://www.trirand.com/blog/jqgrid/js/i18n/grid.locale-en.js"&#62;&#60;/script&#62;<br />&#160;&#160;&#160; &#60;script type="text/javascript"&#62;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $.jgrid.no_legacy_api = true;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $.jgrid.useJSON = true;<br />&#160;&#160;&#160; &#60;/script&#62;<br />&#160;&#160;&#160; &#60;script type="text/javascript" src="http://www.trirand.com/blog/jqgrid/js/jquery.jqGrid.js"&#62;&#60;/script&#62;<br />&#160;&#160;&#160; &#60;script type="text/javascript"&#62;<br />&#160;&#160;&#160; //&#60;![CDATA[<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; /*global $ */<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; /*jslint devel: true, browser: true */</p>
<p>var xml_data_global = "&#60;?xml version=&#39;1.0&#39; encoding=&#39;UTF-8&#39;?&#62;" +<br />"&#60;Order&#62;" +<br />"&#160;&#160; &#160;&#60;Item&#62;" +<br />"&#160;&#160; &#160;&#160;&#160; &#160;&#60;ItemAttributes&#62;" +<br />"&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#60;pos_no&#62;1&#60;/pos_no&#62;" +<br />"&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#60;article_number&#62;&#60;/article_number&#62;" +<br />"&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#60;quantity&#62;1.0&#60;/quantity&#62;" +<br />"&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#60;descrtiption&#62;Article description&#60;/descrtiption&#62;" +<br />"&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#60;price_total&#62;3023.0&#60;/price_total&#62;" +<br />"&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#60;currency&#62;USD&#60;/currency&#62;" +<br />"&#160;&#160; &#160;&#160;&#160; &#160;&#60;/ItemAttributes&#62;" +<br />"&#160;&#160; &#160;&#60;/Item&#62;" +<br />"&#60;/Order&#62;";</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; &#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(document).ready(function () {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;use strict&#39;;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; myGrid = jQuery("#list"),<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; myGrid.jqGrid({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; datastr : xml_data_global,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; datatype: &#39;xmlstring&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colModel: [<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;pos_no&#39;, index: &#39;pos_no&#39;, width: 50 },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;descrtiption&#39;, index: &#39;descrtiption&#39;, width: 200 },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;price_total&#39;, index: &#39;price_total&#39;, width: 200, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; formatter: function (cellvalue, options, rowObject) {<br />&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return cellvalue + &#39; &#39; + rowObject.currency<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;currency&#39;, index: &#39;currency&#39;, width: 100 }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ],<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;xmlReader: {<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;root : "Order", <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;row: "Item", <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;repeatitems: false, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;id: "pos_no"},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortname: &#39;pos_no&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; viewrecords: true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rownumbers: true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortorder: "desc",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; height: "100%",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; pager: &#39;#pager&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; caption: ""<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; });<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; });<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160;<br />&#160;&#160;&#160; //]]&#62;<br />&#160;&#160;&#160; &#60;/script&#62;<br />&#60;/head&#62;</p>
<p>&#60;body&#62;<br />&#60;table id="list"&#62;&#60;tr&#62;&#60;td/&#62;&#60;/tr&#62;&#60;/table&#62;<br />&#60;div id="pager"&#62;&#60;/div&#62;</p>
<p>&#60;/body&#62;<br />&#60;/html&#62;</p>
]]></description>
        	        	<pubDate>Wed, 10 Jul 2013 13:06:55 +0300</pubDate>
        </item>
</channel>
</rss>