<?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: Cannot update records when new column is added in table</title>
	<link>http://www.trirand.com/blog/?page_id=393/releases/cannot-update-records-when-new-column-is-added-in-table</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/releases/cannot-update-records-when-new-column-is-added-in-table/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>jijoseph on Cannot update records when new column is added in table</title>
        	<link>http://www.trirand.com/blog/?page_id=393/releases/cannot-update-records-when-new-column-is-added-in-table#p15574</link>
        	<category>Releases</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/releases/cannot-update-records-when-new-column-is-added-in-table#p15574</guid>
        	        	<description><![CDATA[<p>I have a table with 6 columns and I am able to update the records.&#160; If I add a new column in the table and I update the record (using inline editing, or adding a new record) it shows updated in the grid but when I refresh the page it has not updated. If I delete the additional column it updates.</p>
</p>
<p>Help please.&#160; I am using JQuery Grid 3.6.4</p>
</p>
<p>My Quode:</p>
</p>
<p>&#60;?php<br />require_once "../jq-config.php";</p>
<p>// include the jqGrid Class<br />require_once ABSPATH."php/jqGrid.php";<br />// include the driver class<br />require_once ABSPATH."php/jqGridPdo.php";<br />// Connection to the server<br />/*$conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);*/</p>
<p>$conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD, array<br />(PDO::MYSQL_ATTR_MAX_BUFFER_SIZE=&#62;1024*1024*10));</p>
<p>$conn-&#62;setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);</p>
<p>// Tell the db that we use utf-8<br />$conn-&#62;query("SET NAMES utf8");</p>
<p>// Create the jqGrid instance<br />$grid = new jqGridRender($conn);<br />// Write the SQL Query<br />$grid-&#62;SelectCommand = &#39;Select id, STATION, Country,&#160; YEAR, MO,&#160; D01,F01, F02&#39;;</p>
<p>// Set the table to where we add the data<br />$grid-&#62;table = &#39;daily&#39;;</p>
<p>// Set output format to json<br />$grid-&#62;dataType = &#39;json&#39;;<br />// Let the grid create the model<br />$grid-&#62;setColModel();<br />// Set the url from where we obtain the data<br />$grid-&#62;setUrl(&#39;grid_dailyrainfall.php&#39;);<br />$grid-&#62;addCol(array( <br />&#160;&#160;&#160; "name"=&#62;"actions", <br />&#160;&#160;&#160; "formatter"=&#62;"actions", <br />&#160;&#160;&#160; "editable"=&#62;false, <br />&#160;&#160;&#160; "sortable"=&#62;false, <br />&#160;&#160;&#160; "resizable"=&#62;false, <br />&#160;&#160;&#160; "fixed"=&#62;true, <br />&#160;&#160;&#160; "width"=&#62;60, <br />&#160;&#160;&#160; "formatoptions"=&#62;array("keys"=&#62;true) <br />&#160;&#160;&#160; ), "first");</p>
<p>$grid-&#62;setGridOptions(array( <br />&#160;&#160;&#160; "caption"=&#62;"Data Can Be Filterd Below:",<br />&#160;&#160;&#160; "rowNum"=&#62;50, <br />&#160;&#160;&#160; "hoverrows"=&#62;true,&#160;<br />&#160;&#160;&#160; "rowList"=&#62;array(50,100,150), <br />&#160;&#160;&#160; "sortname"=&#62;"id",<br />&#160;"altRows"=&#62;true,<br />&#160;&#160;&#160; "rownumbers"=&#62;true,<br />&#160;"sortable"=&#62;true,<br />&#160;"autowidth"=&#62;true,<br />&#160;&#160;&#160; "multiselect"=&#62;true,<br />&#160;"scroll"=&#62;1,<br />&#160;"shrinkToFit"=&#62;false<br />));</p>
<p>$grid-&#62;setSelect("Country", "SELECT DISTINCT country_id, Country FROM countries ORDER BY 2", true, true, true, array(""=&#62;"All"));</p>
<p>// Enable navigator<br />$grid-&#62;navigator = true;<br />// Enable toolbar searching<br />$grid-&#62;toolbarfilter = true;<br />$grid-&#62;setFilterOptions(array("stringResult"=&#62;true,"editable"=&#62;false));</p>
<p>// We tell that the primary key is not serial, which should be inserted by the user<br />$grid-&#62;serialKey = true;</p>
<p>// Enable only adding<br />$grid-&#62;setNavOptions(&#39;navigator&#39;, array("excel"=&#62;true,"add"=&#62;true,"edit"=&#62;true,"del"=&#62;true,"view"=&#62;true, "search"=&#62;true));</p>
<p>// Close the dialog after the record is added<br />$grid-&#62;setNavOptions(&#39;add&#39;,array("closeAfterAdd"=&#62;true,"reloadAfterSubmit"=&#62;true));<br />$grid-&#62;setNavOptions(&#39;edit&#39;,array("closeAfterEdit"=&#62;true,"reloadAfterSubmit"=&#62;true));<br />$grid-&#62;setNavOptions(&#39;del&#39;,array("closeAfterDel"=&#62;true,"reloadAfterSubmit"=&#62;true));<br />// Enjoy</p>
<p>$grid-&#62;tarns = false;</p>
<p>$grid-&#62;renderGrid(&#39;#grid&#39;,&#39;#pager&#39;,true, null, null, true,true);<br />$conn = null;<br />?&#62;</p>
]]></description>
        	        	<pubDate>Wed, 10 Mar 2010 10:44:57 +0200</pubDate>
        </item>
</channel>
</rss>