<?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: Question: How to detect if the server side script failed.</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/question-how-to-detect-if-the-server-side-script-failed</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/question-how-to-detect-if-the-server-side-script-failed/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>interlee on Question: How to detect if the server side script failed.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/question-how-to-detect-if-the-server-side-script-failed#p1006</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/question-how-to-detect-if-the-server-side-script-failed#p1006</guid>
        	        	<description><![CDATA[<p>My baaaad.</p>
<p>I realized that I was using unnecessary header information in my server script below. I commented out those and it worked perfect!</p>
<p>Thanks Tony!</p>
<p>if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; header("Content-type: application/xhtml+xml;charset=utf-8");<br />} else {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; header("Content-type: text/xml;charset=utf-8");<br />}</p></p>
]]></description>
        	        	<pubDate>Mon, 07 Jul 2008 12:31:11 +0300</pubDate>
        </item>
        <item>
        	<title>interlee on Question: How to detect if the server side script failed.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/question-how-to-detect-if-the-server-side-script-failed#p1005</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/question-how-to-detect-if-the-server-side-script-failed#p1005</guid>
        	        	<description><![CDATA[<p>Thank you Tony.</p>
<p>In 3.2rc, I tried loadError() function as below.</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; loadError: function (xhr,st,err){<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; alert("Error"+": "+st+"\\n"+xhr.responseText);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; },&#160;&#160;&#160; &#160;&#160;&#160; </p>
<p>It seemed that the function loadError() worked beautifully since it caught the server error and displayed it. (Please see the screen shot: <a href="http://fact-dev.tech.northwestern.edu/temp/parsererror.gif" rel="nofollow" target="_blank"><a href="http://fact-dev.tech.northwest" rel="nofollow">http://fact-dev.tech.northwest</a>.....rerror.gif</a>)</p>
<p>Now, the problem is that I don&#39;t know why I am getting the parsererror message. 🙂</p>
<p>I&#39;m using json_encode as below.</p>
<p>&#60;?php echo json_encode($responce); ?&#62;</p>
<p>And the result of the function json_encode() looks OK to me. For a better readability, I reformatted the result as below:</p>
<p>{<br />&#160;&#160;&#160; "page":"1",<br />&#160;&#160;&#160; "total":1,<br />&#160;&#160;&#160; "records":"6",<br />&#160;&#160;&#160; "rows":[<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {"id":"2008","cell":["2008","2007-2008","No"]},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {"id":"2007","cell":["2007","2006-2007","Yes"]},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {"id":"2006","cell":["2006","2005-2006","No"]},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {"id":"2005","cell":["2005","2004-2005","No"]},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {"id":"2004","cell":["2004","2003-2004","No"]},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {"id":"2003","cell":["2003","2002-2003","No"]}]<br />}</p>
<p>Do you have any idea why I&#39;m getting the "parsererror" message I would really really appreicate any help on this.</p>
<p>Regards,</p>
<p>Daniel</p>
]]></description>
        	        	<pubDate>Mon, 07 Jul 2008 12:07:47 +0300</pubDate>
        </item>
        <item>
        	<title>interlee on Question: How to detect if the server side script failed.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/question-how-to-detect-if-the-server-side-script-failed#p989</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/question-how-to-detect-if-the-server-side-script-failed#p989</guid>
        	        	<description><![CDATA[<p>Thank you Tony.</p>
<p>In 3.2rc, I tried loadError() function as below.</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; loadError: function (xhr,st,err){<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; alert("Error"+": "+st+"\\n"+xhr.responseText);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; },&#160;&#160;&#160; &#160;&#160;&#160; </p>
<p>It seemed that the function loadError() worked beautifully since it caught the server error and displayed it. (Please see the screen shot: <a href="http://fact-dev.tech.northwestern.edu/temp/parsererror.gif" rel="nofollow" target="_blank"><a href="http://fact-dev.tech.northwest" rel="nofollow">http://fact-dev.tech.northwest</a>.....rerror.gif</a>)</p>
<p>Now, the problem is that I don&#39;t know why I am getting the parsererror message. 🙂</p>
<p>I&#39;m using json_encode as below.</p>
<p>&#60;?php echo json_encode($responce); ?&#62;</p>
<p>And the result of the function json_encode() looks OK to me. For a better readability, I reformatted the result as below:</p>
<p>{<br />&#160;&#160;&#160; "page":"1",<br />&#160;&#160;&#160; "total":1,<br />&#160;&#160;&#160; "records":"6",<br />&#160;&#160;&#160; "rows":[<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {"id":"2008","cell":["2008","2007-2008","No"]},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {"id":"2007","cell":["2007","2006-2007","Yes"]},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {"id":"2006","cell":["2006","2005-2006","No"]},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {"id":"2005","cell":["2005","2004-2005","No"]},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {"id":"2004","cell":["2004","2003-2004","No"]},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {"id":"2003","cell":["2003","2002-2003","No"]}]<br />}</p>
<p>Do you have any idea why I&#39;m getting the "parsererror" message I would really really appreicate any help on this.</p>
<p>Regards,</p>
<p>Daniel</p>
]]></description>
        	        	<pubDate>Sat, 05 Jul 2008 12:34:54 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Question: How to detect if the server side script failed.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/question-how-to-detect-if-the-server-side-script-failed#p986</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/question-how-to-detect-if-the-server-side-script-failed#p986</guid>
        	        	<description><![CDATA[<p>Use loadError(xhr,st,err) event more info in this forum topic Releases</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Sat, 05 Jul 2008 03:07:02 +0300</pubDate>
        </item>
        <item>
        	<title>interlee on Question: How to detect if the server side script failed.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/question-how-to-detect-if-the-server-side-script-failed#p984</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/question-how-to-detect-if-the-server-side-script-failed#p984</guid>
        	        	<description><![CDATA[<p>Thank you for the reply. But I was wondering how a grid knows when there was an error in the server scripts (php).</p>
<p>Let&#39;s say that I have a grid that calls a server script (php) which connects to MySQL server and returns result to the grid. And let&#39;s say that the server script could not connect to the MySQL server (or there was an SQL error or whatever&#8230;) Then, how I would like to handle those exception is for the php script to return some kind of generic error message to the grid so that the grid knows that there was an exception in the server script and displays an error message instead of showing the &#8220;Loading&#8230;&#8221; message endlessly.</p>
<p>I know that there is an example how to handle this with the Formedit using the callback function. However, I could not find out how to do this same type of thing for the main grid.</p>
<p>I would really appreciate if anyone can show me a snippet for it. Or please let me know if my questions is not clear enough.</p>
<p>Regards,<br />Daniel</p>
]]></description>
        	        	<pubDate>Fri, 04 Jul 2008 15:33:45 +0300</pubDate>
        </item>
        <item>
        	<title>jan on Question: How to detect if the server side script failed.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/question-how-to-detect-if-the-server-side-script-failed#p980</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/question-how-to-detect-if-the-server-side-script-failed#p980</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>I got the same problem, too.</p>
<p>Did u use XML or Json? I tried the example using Json</p>
<p>and the File is made in php, but don&#180;t know if it is in the correct</p>
<p>way. I use eclipse pdt and started the the php file with &#8220;start as php script&#8221; and the result in the console is like:</p>
<p>localhost{&#8221;page&#8221;:&#8221;1&#8243;,&#8221;total&#8221;:1,&#8221;records&#8221;:&#8221;7&#8243;,&#8221;rows&#8221;:[{"id":"15","cell":["15","2012-12-20","15","12.00","35.00","5.00","jawoll"]},{&#8221;id&#8221;:&#8221;554&#8243;,&#8221;cell&#8221;:["554","2012-08-20","142","4.00","44.00","4.00","52"]},{&#8221;id&#8221;:&#8221;5544&#8243;,&#8221;cell&#8221;:["5544","0000-00-00","4","754.00","11.00","152.00","122200"]},{&#8221;id&#8221;:&#8221;10020&#8243;,&#8221;cell&#8221;:["10020","0000-00-00","12","125.00","12.00","122.00","jo"]},{&#8221;id&#8221;:&#8221;10255&#8243;,&#8221;cell&#8221;:["10255","0000-00-00","15","44.00","111.00","24.00","kein text"]},{&#8221;id&#8221;:&#8221;102554&#8243;,&#8221;cell&#8221;:["102554","2015-10-19","15","45.00","41.00","2.00","1222"]},{&#8221;id&#8221;:&#8221;151223&#8243;,&#8221;cell&#8221;:["151223","0000-00-00","1","15.00","12.00","12.00","1112"]}]}</p>
</p>
<p>I put some dummy data in the Database, but I guess these are irrelevant.</p>
<p>Another thing is that I have the doubt that the variables are not received corretly received with the _GET expression.</p>
<p>For example: $limit = $_GET[&#39;rows&#39;];</p>
<p>In the php i have to set $limit manually to 10, otherwise i get a &#8220;division by zero&#8221; error from this expression:</p>
<p>$total_pages = ceil($count/$limit);</p>
</p>
<p>best regards</p>
<p>jan</p>
]]></description>
        	        	<pubDate>Thu, 03 Jul 2008 10:13:00 +0300</pubDate>
        </item>
        <item>
        	<title>interlee on Question: How to detect if the server side script failed.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/question-how-to-detect-if-the-server-side-script-failed#p979</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/question-how-to-detect-if-the-server-side-script-failed#p979</guid>
        	        	<description><![CDATA[<p>Hi,</p>
</p>
<p>When there is an error in a server side script (php), the grid displays the messsage "Loading..." endlessly. Would you please let me know how to handle exceptions (errors) in a server side script so that I can display error messages when there were problems with the server side script?</p>
</p>
<p>Regards,</p>
<p>Daniel</p>
]]></description>
        	        	<pubDate>Thu, 03 Jul 2008 09:10:06 +0300</pubDate>
        </item>
</channel>
</rss>