<?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: Can't get data JSON</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/cant-get-data-json</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/cant-get-data-json/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Bulgarin on Can't get data JSON</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/cant-get-data-json#p27528</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/cant-get-data-json#p27528</guid>
        	        	<description><![CDATA[<p>Hi Tony,</p>
<p>I read the documentation.</p>
<p>My service return documents&#39; info and I add it to &#39;listDocs&#39;. After, I add this list to &#39;result&#39; and serealized it. This result can&#39;t add to jqgrid. And now with many changes I fix this.</p>
<p>But I have another problem - My grid can&#39;t refresh... I add a button to delete a file from my system. In the end of &#39;onclick&#39;-method for this button I have</p>
<blockquote>
<p>$.ajax({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; url: &#39;MyPage,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; data: "{}",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; dataType: "json",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; type: "POST",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; contentType: "application/json; charset=utf-8",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; success: function(data) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery("#myJqGrid").jqGrid(&#39;setGridParam&#39;, { data: data }).trigger(&#39;reloadGrid&#39;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; });</p>
</p>
</blockquote>
<p>And with this I get new data from codebehind method in "MyPage" (this is aspx page). &#39;data&#39;-object has new values , set it to grid&#39;s data, but not refresh the grid with new values.</p>
<p>Can you help me?</p>
<p>Thanks!</p>
]]></description>
        	        	<pubDate>Fri, 12 Oct 2012 09:09:48 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Can't get data JSON</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/cant-get-data-json#p27510</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/cant-get-data-json#p27510</guid>
        	        	<description><![CDATA[<p>Hello,</p>
</p>
<p>I have difficulties to understand the problem.</p>
<p>What you want to post and from where?</p>
<p>Maybe you will need to look at <a href="/jqgridwiki/doku.php?id=wiki:inline_editing#what_is_posted_to_the_server" target="_blank">documentation here</a></p>
</p>
<p>Regards</p>
]]></description>
        	        	<pubDate>Thu, 11 Oct 2012 17:22:26 +0300</pubDate>
        </item>
        <item>
        	<title>Bulgarin on Can't get data JSON</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/cant-get-data-json#p27505</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/cant-get-data-json#p27505</guid>
        	        	<description><![CDATA[<p>Hello.</p>
<p>I tried to get data from my service and post in jqGrid.</p>
<p>I get data from service, but I can&#39;t post values.</p>
<p>Can you help me?</p>
<p>This is my code:</p>
<blockquote>
<p>jQuery("#tblFormsGrid").jqGrid({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; url: &#39;MyPage.aspx?MyMethod=GetDocumentsInfo&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; datatype: &#39;json&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; type: &#39;POST&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ajaxGridOptions: { contentType: "application/json" },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; contentType: &#39;application/json; charset=utf-8&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; jsonReader: {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; root: "d.rows",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; page: "d.page",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; total: "d.total",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; records: "d.records"<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; mtype: &#39;GET&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; height: 330,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; width: 740,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; colNames: [&#39;ID&#39;, &#39;Name&#39;, &#39;Number&#39;, &#39;Uploaded By&#39;, &#39;Modified By&#39;, &#39;Last Modified&#39;, &#39;File Size&#39;, &#39;History&#39;],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; colModel: [<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;id&#39;, index: &#39;id&#39;, width: 10, sortable: false, hidden: true },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;name&#39;, index: &#39;name&#39;, width: 200, sorttype: "string" },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;Num&#39;, index: &#39;Num&#39;, width: 90, sorttype: "string" },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;uploadedBy&#39;, index: &#39;uploadedBy&#39;, width: 90, sorttype: "string" },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;modifiedBy&#39;, index: &#39;modifiedBy&#39;, width: 90, sorttype: "string" },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;dateModified&#39;, index: &#39;dateModified&#39;, width: 100, sorttype: "date" },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;fileSize&#39;, index: &#39;fileSize&#39;, width: 100, sorttype: "int" },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;btnHistory&#39;, index: &#39;btnHistory&#39;, width: 100, sortable: false}],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; multiselect: true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; caption: "Forms",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; rowNum: 15,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; hiddengrid: true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; gridview: true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; gridComplete: function() {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var ids = jQuery("#tblFormsGrid").jqGrid(&#39;getDataIDs&#39;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; for (var i = 0; i &#60; ids.length; i++) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var row_id = ids[i];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var btnHis = "&#60;span class=&#39;LinkButton&#39; onclick="GetRowData(" + row_id + ")" &#62;View History&#60;/span&#62;";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery("#tblFormsGrid").jqGrid(&#39;setRowData&#39;, ids[i], { btnHistory: btnHis });<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160; });</p>
</p>
<p>CodeBehind:</p>
<p>int vetId = GetVetId();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; MyService dmsc = new MyService();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var docs = dmsc.GetAll(param1, param2);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var documents = docs.Data;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; List&#60;object&#62; listDocs = new List&#60;object&#62;();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; foreach (myDoc doc in documents)<br />&#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; listDocs.Add(new<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; id = doc.Id.ToString(),<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; name = doc.Name,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Num = "none",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; modifiedBy = doc.ModifiedBy,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; uploadedBy = doc.ModifiedBy,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; dateModified = doc.Modified,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; btnHistory=""<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; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var result = new<br />&#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; page = "1",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; total = "1",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; records = "15",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rows = listDocs<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; };<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.Web.Script.Serialization.JavaScriptSerializer oSerializer =<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; new System.Web.Script.Serialization.JavaScriptSerializer();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; object jsn = oSerializer.Serialize(result);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Response.Write(jsn);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Response.End();&#160;&#160;</p>
</blockquote>
]]></description>
        	        	<pubDate>Wed, 10 Oct 2012 10:42:27 +0300</pubDate>
        </item>
</channel>
</rss>