<?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: Type casting for maximum compatibility??</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/type-casting-for-maximum-compatibility</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/bugs/type-casting-for-maximum-compatibility/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>nayrsivart on Type casting for maximum compatibility??</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/type-casting-for-maximum-compatibility#p10579</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/type-casting-for-maximum-compatibility#p10579</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>I am not certain but would like to open a discussion on type casting for jqGrid. &#160;While building a viewHelper in Zend Framework for jqGrid I wanted to allow the use of Zend Config for defining column names and params. &#160;While doing this I found two things that were issues for this. &#160;Zend Config loads both INI and XML files with 100% of their values as strings. &#160;It seems on their end there should be some way to explicitly type hint values but currently there is not.</p>
</p>
<p>With that said, loading from a Zend Config object I was forced to map out every possible option available in jqGrid as defined in the documentation and iterate through the params and cast them appropriately. &#160;I believe, but have yet to confirm, that jqGrid is using === vs == which is requiring an exact type. &#160;Everything works fine except for booleans when using JSON.</p>
</p>
<p>The value in PHP is converted to "1" when using JSON encode. &#160;This obviously is a string and could be casted in both languages as a boolean.</p>
</p>
<p>I like the idea of using explicit types so I am leaning toward lobbying Zend to change up their code to allow type hinting in config objects. &#160;Alternatively in jqGrid you could cast the values or not use ===. &#160;Generally if I am going to use === I will attempt to cast the value before using that operator.</p>
</p>
<p><img class="spSmiley" style="margin:0" title="Laugh" src="http://www.trirand.com/blog/wp-content/forum-smileys/sf-laugh.gif" alt="Laugh" /></p>
]]></description>
        	        	<pubDate>Fri, 09 Oct 2009 02:07:37 +0300</pubDate>
        </item>
</channel>
</rss>