<?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: Help with jqGrid values disappear when click on Add button</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/help-with-jqgrid-values-disappear-when-click-on-add-button</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/help-with-jqgrid-values-disappear-when-click-on-add-button/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>gena_mak on Help with jqGrid values disappear when click on Add button</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/help-with-jqgrid-values-disappear-when-click-on-add-button#p27452</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/help-with-jqgrid-values-disappear-when-click-on-add-button#p27452</guid>
        	        	<description><![CDATA[<p>Hello,<br />I asked the question before but, I realized it was not clear enough (English is not my first language). So, I will try again with working example that I took from some site.</p>
<p>The link to working grid is here to the Example page: <a href="https://www.easyflex.com/accnttrx_conf3.cfm" rel="nofollow" target="_blank">https://www.easyflex.com/accnttrx_conf3.cfm</a>;..038;hellip;..038;hellip;..038;hellip;..038;hellip;..strict.dtd"&#62;<br />&#60;html xmlns="http://www.w3.org/1999/xhtml;..038;hellip;..038;hellip;..038;hellip;..038;hellip;..le&#38;gt;<br />&#160;&#160;&#160; &#60;meta http-equiv="Content-Type" content="text/html; charset=utf-8&#8243; /&#62;</p>
<p>&#160;&#160;&#160; &#60;link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/redmond/jquery-ui.css;..038;hellip;..038;hellip;..038;hellip;..038;hellip;..ery-ui.css" /&#62;<br />&#160;&#160;&#160; &#60;link rel="stylesheet" type="text/css" href="http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-4.2.0/plugin/ui.multiselect.css;..038;hellip;..038;hellip;..038;hellip;..038;hellip;..select.css" /&#62;<br />&#160;&#160;&#160; &#60;link rel="stylesheet" type="text/css" href="http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-4.2.0/css/ui.jqgrid3.css;..038;hellip;..038;hellip;..038;hellip;..038;hellip;..qgrid3.css" /&#62;<br />&#160;&#160;&#160; &#60;style type="text/css"&#62;<br />&#160;&#160;&#160; &#60;/style&#62;<br />&#160;&#160;&#160; &#60;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js%22%3E%3C/script;..038;hellip;..038;hellip;..038;hellip;..038;hellip;..ery.min.js"&#62;&#60;/script&#62;<br />&#160;&#160;&#160; &#60;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js%22%3E%3C/script;..038;hellip;..038;hellip;..038;hellip;..038;hellip;..-ui.min.js"&#62;&#60;/script&#62;<br />&#160;&#160;&#160; &#60;script type="text/javascript" src="http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-4.2.0/js/i18n/grid.locale-en.js%22%3E%3C/script;..038;hellip;..038;hellip;..038;hellip;..038;hellip;..cale-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.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-4.2.0/plugin/ui.multiselect.js%22%3E%3C/script;..038;hellip;..038;hellip;..038;hellip;..038;hellip;..iselect.js"&#62;&#60;/script&#62;<br />&#160;&#160;&#160; &#60;script type="text/javascript" src="http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-4.2.0/js/jquery.jqGrid.src.js%22%3E%3C/script;..038;hellip;..038;hellip;..038;hellip;..038;hellip;..rid.src.js"&#62;&#60;/script&#62;</p>
<p>&#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 browser: true, plusplus: true */<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $.jgrid.formatter.integer.thousandsSeparator = &#39;,&#39;;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $.jgrid.formatter.number.thousandsSeparator = &#39;,&#39;;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $.jgrid.formatter.currency.thousandsSeparator = &#39;,&#39;;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(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; var mydata = [<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {id: "1",&#160; invdate: "2007-10-01", name: "test",&#160;&#160; note: "note",&#160;&#160; amount: "200.00", tax: "10.00", closed: true,&#160; ship_via: "TN", total: "210.00"},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {id: "2",&#160; invdate: "2007-10-02", name: "test2",&#160; note: "note2",&#160; amount: "300.00", tax: "20.00", closed: false, ship_via: "FE", total: "320.00"},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {id: "3",&#160; invdate: "2007-09-01", name: "test3",&#160; note: "note3",&#160; amount: "400.00", tax: "30.00", closed: false, ship_via: "FE", total: "430.00"},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {id: "4",&#160; invdate: "2007-10-04", name: "test4",&#160; note: "note4",&#160; amount: "200.00", tax: "10.00", closed: true,&#160; ship_via: "TN", total: "210.00"},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {id: "5",&#160; invdate: "2007-10-31", name: "test5",&#160; note: "note5",&#160; amount: "300.00", tax: "20.00", closed: false, ship_via: "FE", total: "320.00"},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {id: "6",&#160; invdate: "2007-09-06", name: "test6",&#160; note: "note6",&#160; amount: "400.00", tax: "30.00", closed: false, ship_via: "FE", total: "430.00"},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {id: "7",&#160; invdate: "2007-10-04", name: "test7",&#160; note: "note7",&#160; amount: "200.00", tax: "10.00", closed: true,&#160; ship_via: "TN", total: "210.00"},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {id: "8",&#160; invdate: "2007-10-03", name: "test8",&#160; note: "note8",&#160; amount: "300.00", tax: "20.00", closed: false, ship_via: "FE", total: "320.00"},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {id: "9",&#160; invdate: "2007-09-01", name: "test9",&#160; note: "note9",&#160; amount: "400.00", tax: "30.00", closed: false, ship_via: "TN", total: "430.00"},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {id: "10", invdate: "2007-09-08", name: "test10", note: "note10", amount: "500.00", tax: "30.00", closed: true,&#160; ship_via: "TN", total: "530.00"},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {id: "11", invdate: "2007-09-08", name: "test11", note: "note11", amount: "500.00", tax: "30.00", closed: false, ship_via: "FE", total: "530.00"},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {id: "12", invdate: "2007-09-10", name: "test12", note: "note12", amount: "500.00", tax: "30.00", closed: false, ship_via: "FE", total: "530.00"}<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;&#160;&#160;&#160; $myGrid = $("#list"),<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; selRowData = null;</p>
<p>&#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; datatype: &#39;local&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; data: mydata,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colNames: [&#39;Inv No&#39;, &#39;Date&#39;, &#39;Client&#39;, &#39;Amount&#39;, &#39;Tax&#39;, &#39;Total&#39;, &#39;Closed&#39;, &#39;Shipped via&#39;, &#39;Notes&#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;id&#39;, index: &#39;id&#39;, width: 65, align: &#39;center&#39;, sorttype: &#39;int&#39;, hidden: true},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name: &#39;invdate&#39;, index: &#39;invdate&#39;, width: 80, align: &#39;center&#39;, sorttype: &#39;date&#39;,<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: &#39;date&#39;, formatoptions: {newformat: &#39;d-M-Y&#39;}, datefmt: &#39;d-M-Y&#39;},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name: &#39;name&#39;, index: &#39;name&#39;, width: 70, editable: true, editoptions: {<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;&#160; defaultValue: function () {<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;&#160;&#160;&#160;&#160;&#160; return selRowData === null ? &#39;&#39; : &#39;_&#39; + selRowData.name + &#39;_&#39;;<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;&#160; }<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;amount&#39;, index: &#39;amount&#39;, width: 75, formatter: &#39;number&#39;, sorttype: &#39;number&#39;, editable: true, align: &#39;right&#39;},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name: &#39;tax&#39;, index: &#39;tax&#39;, width: 55, formatter: &#39;number&#39;, sorttype: &#39;number&#39;, editable: true, align: &#39;right&#39;, hidden: true},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name: &#39;total&#39;, index: &#39;total&#39;, width: 65, formatter: &#39;number&#39;, sorttype: &#39;number&#39;, editable: true, align: &#39;right&#39;},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name: &#39;closed&#39;, index: &#39;closed&#39;, width: 75, align: &#39;center&#39;, formatter: &#39;checkbox&#39;, editable: true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; edittype: &#39;checkbox&#39;, editoptions: {value: &#39;Yes:No&#39;, defaultValue: &#39;Yes&#39;}},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name: &#39;ship_via&#39;, index: &#39;ship_via&#39;, width: 100, align: &#39;center&#39;, formatter: &#39;select&#39;, editable: true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; edittype: &#39;select&#39;, editoptions: {value: &#39;FE:FedEx;TN:TNT;IN:Intim&#39;, defaultValue: &#39;Intime&#39;}},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name: &#39;note&#39;, index: &#39;note&#39;, width: 70, editable: true, sortable: false}<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;&#160;&#160;&#160; rowNum: 10,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rowList: [5, 10, 20],<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; gridview: 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; sortname: &#39;invdate&#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; sortorder: &#39;desc&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ondblClickRow: function (rowid, iRow, iCol, e) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; alert(rowid);<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;&#160;&#160;&#160; caption: &#39;Grid with moved multiselect chachboxes&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; height: &#39;auto&#39;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; });</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $myGrid.jqGrid (&#39;navGrid&#39;, &#39;#pager&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {add: true, del: false, refresh: true, view: false},<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;&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; beforeInitData: function () {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var rowid = $myGrid.jqGrid(&#39;getGridParam&#39;, &#39;selrow&#39;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; selRowData = rowid !== null ? $myGrid.jqGrid(&#39;getRowData&#39;, rowid): null;<br />&#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; },<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;&#160;&#160;&#160; {multipleSearch: true, overlay: false});<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; });<br />&#160;&#160;&#160; //]]&#62;<br />&#160;&#160;&#160; &#60;/script&#62;<br />&#60;/head&#62;<br />&#60;body&#62;<br />&#160;&#160;&#160; &#60;table id="list"&#62;&#60;tr&#62;&#60;td/&#62;&#60;/tr&#62;&#60;/table&#62;<br />&#160;&#160;&#160; &#60;div id="pager"&#62;&#60;/div&#62;<br />&#60;/body&#62;<br />&#60;/html&#62;</p>
]]></description>
        	        	<pubDate>Mon, 01 Oct 2012 19:35:45 +0300</pubDate>
        </item>
</channel>
</rss>