<?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: problem with custom element</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/problem-with-custom-element</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/problem-with-custom-element/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>alexspb on problem with custom element</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/problem-with-custom-element#p27356</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/problem-with-custom-element#p27356</guid>
        	        	<description><![CDATA[<p>i find solution. My problem appeared because i generate model in php as array and passed in javascript json_encode. javascript don&#39;t determine that&#160;myelem is function.</p>
<p>jquery.jqGrid.src.js line 5914:</p>
<p>if($.isFunction(options.custom_element)) {.....</p>
</p>
<p>my solution:</p>
<p>lines 5913-5926 (block "try") replace to:</p>
<p>try { 						var celm = window[options.custom_element]($t,vl,options); 							celm = $(celm).addClass("customelement").attr({id:options.id,name:options.name}); 							$(elem).empty().append(celm); 				}</p>
]]></description>
        	        	<pubDate>Wed, 19 Sep 2012 13:17:26 +0300</pubDate>
        </item>
        <item>
        	<title>alexspb on problem with custom element</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/problem-with-custom-element#p27252</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/problem-with-custom-element#p27252</guid>
        	        	<description><![CDATA[<p>Hello</p>
<p>I do:</p>
<pre class="code javascript">&#60;script&#62;
function myelem (value, options) {
  var el = document.createElement("input");
  el.type="text";
  el.value = value;
  return el;
}
&#160;
function myvalue(elem, operation, value) {
    if(operation === &#39;get&#39;) {
       return $(elem).find("input").val();
    } else if(operation === &#39;set&#39;) {
       $(&#39;input&#39;,elem).val(value);
    }
}
jQuery("#grid_id").jqGrid({
...
   colModel: [ 
      ... 
      {name:&#39;price&#39;, ..., editable:true, edittype:&#39;custom&#39;, editoptions:{custom_element: myelem, custom_value:myvalue} },
      ...
   ]
...
});
&#60;/script&#62;</pre>
<pre class="code javascript">Result: Error e1. How i can do custom element?</pre>
]]></description>
        	        	<pubDate>Mon, 03 Sep 2012 15:26:02 +0300</pubDate>
        </item>
</channel>
</rss>