<?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: jqgrid json object paging &#38; searching not working</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-json-object-paging-searching-not-working</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/jqgrid-json-object-paging-searching-not-working/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>cfexpert on jqgrid json object paging &#38; searching not working</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-json-object-paging-searching-not-working#p29904</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-json-object-paging-searching-not-working#p29904</guid>
        	        	<description><![CDATA[<p>Tony,</p>
</p>
<p>I am also getting same problem. Search and paging are not working for the JSON.</p>
<p>I am using simple grid.</p>
</p>
<p>Please see the following code.</p>
</p>
<p>&#60;/script&#62;		});			$("##list").jqGrid(&#39;navGrid&#39;,&#39;##pager&#39;,{add:false,edit:false,del:false});			});				}					id: "id"					cell: "",					total: "TOTAL",					page: "PAGE",					root: "ROWS",				jsonReader: {				caption: "#rc.grid#",				viewrecords: true,				sortorder: "desc",				rowList:[10,20,30],				rowNum:10,				},					$("##"+subgrid_table_id).jqGrid(&#39;navGrid&#39;,"##"+pager_id,{edit:false,add:false,del:false})					});				 jsonReader: { repeatitems : false, root:"attribute" }						width: &#39;100%&#39;,					 &#160; &#160;height: &#39;100%&#39;,						autowidth: "true",					 &#160; // sortorder: "asc",					 &#160; //	sortname: &#39;VOL1&#39;,						//pager: pager_id,					 &#160; &#160;pager: &#160;$("##"+pager_id),						viewrecords: true,						rowList:[10,20,30],					 &#160; 	rowNum:10,						],							{name:"PAID_RANK",index:"PAID_RANK",align:"center"}							{name:"STATUS",index:"STATUS",align:"center"},							{name:"VOL1",index:"VOL1",align:"center",formatter:&#39;number&#39;,formatoptions:{decimalPlaces:0,thousandsSeparator:""}},							{name:"LEVEL",index:"LEVEL",align:"center"},							{name:"NAME",index:"NAME",align:"left"},							{name:"DIST_ID",index:"DIST_ID",align:"center",key:true},						colModel: [						colNames: [&#39;DIST_ID&#39;,&#39;NAME&#39;,&#39;LEVEL&#39;,&#39;VOL1&#39;,&#39;STATUS&#39;,&#39;PAID_RANK&#39;],&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; datatype: &#39;json&#39;,												url:"index.cfm?event=Hierarchical_Grid.viewHierarchical_SubGrid&#38;id="+row_id+"&#38;distID="+distID+"&#38;DTS_Detail="+DTS_Detail,					$("##"+subgrid_table_id).jqGrid({					$("##"+subgrid_id).html("&#60;table id=&#39;"+subgrid_table_id+"&#39; class=&#39;scroll&#39;&#62;&#60;/table&#62;&#60;div id=&#39;"+pager_id+"&#39; class=&#39;scroll&#39;&#62;&#60;/div&#62;");					DTS_Detail=$("##client option:selected").val();					distID=$("##list").getCell(row_id,&#39;DIST_ID&#39;);					//alert(pager_id);					 //alert(orderid);					 //var orderid = rowdata.DIST_ID;					 //var rowdata = jQuery(&#39;##list&#39;).getRowData(row_id);					pager_id="p_"+subgrid_table_id;					subgrid_table_id = subgrid_id+"_t";					var distID,DTS_Detail;					var pager_id;					var subgrid_table_id,pager_id,distID;				subGridRowExpanded: function(subgrid_id, row_id) {				},					"selectOnExpand": true					// select the row when the expand column is clicked					"reloadOnExpand": false,					// load the subgrid data only once and the just show/hide			 &#160; &#160; &#160; &#160;"openicon": "ui-icon-arrowreturn-1-e",			 &#160; &#160; &#160; &#160;"minusicon": "ui-icon-triangle-1-s",			 &#160; &#160; &#160; &#160;"plusicon": "ui-icon-triangle-1-e",			 &#160; &#160;subGridOptions: {				// define the icons in subgrid								subGrid: true,				pager: $(&#39;##pager&#39;),				width: 1100,				height: "auto",				loadui: "enable",					{name:&#39;PAID_RANK&#39;,index:&#39;PAID_RANK&#39;,align:"center",sorttype:"int"}],					{name:&#39;VOL3&#39;,index:&#39;VOL3&#39;,align:"center",sorttype:"int",formatter:&#39;number&#39;,formatoptions:{decimalPlaces:0,thousandsSeparator:""}},					{name:&#39;NAME&#39;,index:&#39;NAME&#39;,align:"left",sorttype:"string"},					{name:&#39;DIST_ID&#39;,index:&#39;DIST_ID&#39;,align:"center",sorttype:"int"},				colModel:[				colNames:[&#39;DIST_ID&#39;,&#39;NAME&#39;,&#39;VOL3&#39;,&#39;PAID_RANK&#39;],				datatype: &#39;local&#39;,				data: #SerializeJSON(prc.griddata)#,			$("##list").jqGrid({		$(document).ready(function(){&#60;script type="text/javascript"&#62;</p>
]]></description>
        	        	<pubDate>Fri, 29 Nov 2013 11:09:59 +0200</pubDate>
        </item>
        <item>
        	<title>tony on jqgrid json object paging &#38; searching not working</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-json-object-paging-searching-not-working#p29497</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-json-object-paging-searching-not-working#p29497</guid>
        	        	<description><![CDATA[<p>Hello,</p>
</p>
<p>It seems to me you do not read my post carfully.</p>
<p>Please read it again. TRY TO USE A VERY SIMPLE JQGRID SETUP AS FROM THE DEMOS.</p>
</p>
<p>Regards</p>
]]></description>
        	        	<pubDate>Thu, 19 Sep 2013 11:48:36 +0300</pubDate>
        </item>
        <item>
        	<title>sarvani on jqgrid json object paging &#38; searching not working</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-json-object-paging-searching-not-working#p29494</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-json-object-paging-searching-not-working#p29494</guid>
        	        	<description><![CDATA[<p>help me</p>
]]></description>
        	        	<pubDate>Wed, 18 Sep 2013 20:24:48 +0300</pubDate>
        </item>
        <item>
        	<title>sarvani on jqgrid json object paging &#38; searching not working</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-json-object-paging-searching-not-working#p29467</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-json-object-paging-searching-not-working#p29467</guid>
        	        	<description><![CDATA[<blockquote>
<p>sarvani said:</p>
<blockquote>
<p>tony said:</p>
<p>Hello,</p>
</p>
<p>Try first not to ovrewrite the default jqGrid ajax succes function.</p>
<p>The pagging, sorting and serching in your case is a server side job, so I recommend you to lookat your server side code.</p>
</p>
<p>Regards</p>
</p>
</blockquote>
<hr />
<p>Thank you tony</p>
<p>Here is my server code</p>
</p>
<pre class="default prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit139' value='Select Code' data-codeid='sfcode139' /></p><div class='sfcode' id='sfcode139'>public static s_GridResult GetDataTable(string _search, string nd, int rows, int page, string sidx,</div></pre>
<pre class="default prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit6986' value='Select Code' data-codeid='sfcode6986' /></p><div class='sfcode' id='sfcode6986'>string sord, string FilePath, string Filter, string submenu)
{

    int startindex = (page - 1);
    int endindex = page;
    DataTable dt = xxxxxxxx;//returns datatable
    s_GridResult result = new s_GridResult();
    List&#60;s_RowData&#62; rowsadded = new List&#60;s_RowData&#62;();
    int idx = 1;
    foreach (DataRow row in dt.Rows)
    {
        s_RowData newrow = new s_RowData();
        newrow.id = idx++;
        newrow.cell = new string[4];  //total number of columns  
        newrow.cell[0] = row[0].ToString();
        newrow.cell[1] = row[1].ToString();
        newrow.cell[2] = row[2].ToString();
        newrow.cell[3] = row[4].ToString();
        rowsadded.Add(newrow);
    }
    result.rows = rowsadded.ToArray();
    result.page = page;
    result.total = dt.Rows.Count;
    result.record = rowsadded.Count;
    return result;
}</div></pre>
<pre class="default prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit3106' value='Select Code' data-codeid='sfcode3106' /></p><div class='sfcode' id='sfcode3106'></div></pre>
<pre class="default prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit4932' value='Select Code' data-codeid='sfcode4932' /></p><div class='sfcode' id='sfcode4932'></div></pre>
<pre class="default prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit9775' value='Select Code' data-codeid='sfcode9775' /></p><div class='sfcode' id='sfcode9775'>Plzz Help me </div><p><input type='button' class='sfcodeselect' name='sfselectit3911' value='Select Code' data-codeid='sfcode3911' /></p><div class='sfcode' id='sfcode3911'>i&#39;m new to jqgrid...:(</div></pre>
</blockquote>
<hr />
]]></description>
        	        	<pubDate>Fri, 13 Sep 2013 14:07:47 +0300</pubDate>
        </item>
        <item>
        	<title>sarvani on jqgrid json object paging &#38; searching not working</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-json-object-paging-searching-not-working#p29466</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-json-object-paging-searching-not-working#p29466</guid>
        	        	<description><![CDATA[<blockquote>
<p>tony said:</p>
<p>Hello,</p>
</p>
<p>Try first not to ovrewrite the default jqGrid ajax succes function.</p>
<p>The pagging, sorting and serching in your case is a server side job, so I recommend you to lookat your server side code.</p>
</p>
<p>Regards</p>
</p>
</blockquote>
<hr />
<p>Thank you tony</p>
<p>Here is my server code</p>
</p>
<pre class="default prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit7454' value='Select Code' data-codeid='sfcode7454' /></p><div class='sfcode' id='sfcode7454'>public static s_GridResult GetDataTable(string _search, string nd, int rows, int page, string sidx,</div></pre>
<pre class="default prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit2020' value='Select Code' data-codeid='sfcode2020' /></p><div class='sfcode' id='sfcode2020'>string sord, string FilePath, string Filter, string submenu)
{

    int startindex = (page - 1);
    int endindex = page;
    DataTable dt = xxxxxxxx;//returns datatable
    s_GridResult result = new s_GridResult();
    List&#60;s_RowData&#62; rowsadded = new List&#60;s_RowData&#62;();
    int idx = 1;
    foreach (DataRow row in dt.Rows)
    {
        s_RowData newrow = new s_RowData();
        newrow.id = idx++;
        newrow.cell = new string[4];  //total number of columns  
        newrow.cell[0] = row[0].ToString();
        newrow.cell[1] = row[1].ToString();
        newrow.cell[2] = row[2].ToString();
        newrow.cell[3] = row[4].ToString();
        rowsadded.Add(newrow);
    }
    result.rows = rowsadded.ToArray();
    result.page = page;
    result.total = dt.Rows.Count;
    result.record = rowsadded.Count;
    return result;
}</div></pre>
<pre class="default prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit4346' value='Select Code' data-codeid='sfcode4346' /></p><div class='sfcode' id='sfcode4346'><br /></div></pre>
<pre class="default prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit5641' value='Select Code' data-codeid='sfcode5641' /></p><div class='sfcode' id='sfcode5641'><br /></div></pre>
<pre class="default prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit6013' value='Select Code' data-codeid='sfcode6013' /></p><div class='sfcode' id='sfcode6013'>Plzz Help me <img class="spSmiley" style="margin:0" title="Frown" src="/blog/wp-content/forum-smileys/sf-frown.gif" alt="Frown" /></div></pre>
]]></description>
        	        	<pubDate>Fri, 13 Sep 2013 14:06:15 +0300</pubDate>
        </item>
        <item>
        	<title>tony on jqgrid json object paging &#38; searching not working</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-json-object-paging-searching-not-working#p29462</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-json-object-paging-searching-not-working#p29462</guid>
        	        	<description><![CDATA[<p>Hello,</p>
</p>
<p>Try first not to ovrewrite the default jqGrid ajax succes function.</p>
<p>The pagging, sorting and serching in your case is a server side job, so I recommend you to lookat your server side code.</p>
</p>
<p>Regards</p></p>
]]></description>
        	        	<pubDate>Fri, 13 Sep 2013 11:44:49 +0300</pubDate>
        </item>
        <item>
        	<title>sarvani on jqgrid json object paging &#38; searching not working</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-json-object-paging-searching-not-working#p29456</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-json-object-paging-searching-not-working#p29456</guid>
        	        	<description><![CDATA[<pre class="default prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit5010' value='Select Code' data-codeid='sfcode5010' /></p><div class='sfcode' id='sfcode5010'>Hi i&#39;m using jqgrid and json object.i&#39;m getting the data but paging and search not working..means when i click on next page same data is appearing and in search too..plzzz help me.</div></pre>
<pre class="default prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit3566' value='Select Code' data-codeid='sfcode3566' /></p><div class='sfcode' id='sfcode3566'><br /></div></pre>
<pre class="default prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit4510' value='Select Code' data-codeid='sfcode4510' /></p><div class='sfcode' id='sfcode4510'><pre class="default prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit9015' value='Select Code' data-codeid='sfcode9015' /></p><div class='sfcode' id='sfcode9015'>my entire jqGrid, for reference:</div></pre>
<pre class="default prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit6281' value='Select Code' data-codeid='sfcode6281' /></p><div class='sfcode' id='sfcode6281'><br /></div></pre>
</div>
<pre class="default prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit6707' value='Select Code' data-codeid='sfcode6707' /></p><div class='sfcode' id='sfcode6707'>$(document).ready(function () {
    var numberTemplate = { formatter: &#39;number&#39;, align: &#39;center&#39;, sorttype: &#39;number&#39; };
    jQuery("#UsersGrid").jqGrid({
        url: &#39;Jqg.aspx/GetDataTable&#39;,
        datatype: &#39;json&#39;,
        mtype: &#39;GET&#39;,
        ajaxGridOptions: { contentType: "application/json",
            success: function (data, textStatus) {
                if (textStatus == "success") {
                    var thegrid = $("#UsersGrid")[0];
                    thegrid.addJSONData(data.d);
                    thegrid.grid.hDiv.loading = false; alert(&#39;success&#39;);
                    switch (thegrid.p.loadui) {
                        case "disable":
                            break;
                        case "enable":
                            $("#load_" + thegrid.p.id).hide();
                            break;
                        case "block":
                            $("#lui_" + thegrid.p.id).hide();
                            $("#load_" + thegrid.p.id).hide();
                            break;
                    }
                }
            },
            error: alert(&#39;failed&#39;)
        },

        postData: {
            FilePath: function () {
                return $("#FilePath").text();
            },
            Filter: function () {
                return $("#Filter").text();
            },
            submenu: function () {
                return $("#lblSubmenu").text();
            }
        },
        mtype: &#39;POST&#39;,
        colNames: [&#39;Sr_No&#39;, &#39;Errors&#39;, &#39;File Name&#39;, &#39;Date&#39;, &#39;action&#39;],
        colModel: [{ name: &#39;Sr_No&#39;, index: &#39;Sr_No&#39;, key: true, width: 100, align: &#39;center&#39;, sortable: true, sorttype: &#39;integer&#39;, searchtype: "integer", searchrules: { "required": true, "number": true, "maxValue": 13} },
               { name: &#39;Errors&#39;, index: &#39;Errors&#39;, width: 100, align: &#39;center&#39;, search: true, sorttype: "int", sortable: true },
               { name: &#39;File Name&#39;, index: &#39;files&#39;, search: true, stype: &#39;text&#39;, width: 500, sorttype: "string", align: &#39;center&#39;, sortable: true },
               { name: &#39;Date&#39;, index: &#39;Date&#39;, width: 100, search: true, sortable: true, sorttype: "date", align: &#39;center&#39;, sorttype: &#39;date&#39;,
                   formatter: &#39;date&#39;, formatoptions: { newformat: &#39;M-d-Y&#39; }, datefmt: &#39;M-d-Y&#39;
               },
               { name: &#39;action&#39;, index: &#39;action&#39;, align: &#39;center&#39;, sortable: false, search: false, formatter: displayButtons}],
        pager: &#39;#UsersGridPager&#39;,
        viewrecords: true,
        imgpath: &#39;Images/jqgrid&#39;,
        rowNum: 5,
        rowList: [5, 10, 20],
        gridview: true,
        loadonce: false,
        rownumbers: false,
        sortname: &#39;Sr_No&#39;,
        sortorder: &#39;desc&#39;,
        localReader: { id: &#39;Sr_No&#39; },
        editurl: &#39;clientArray&#39;,
        clickOnPagination : function() { $(this).jqGrid("clearGridData"); $(this).setGridParam({datatype: &#39;json&#39;}).triggerHandler("reloadGrid"); },
        cmTemplate: {
            searchoptions: {
                sopt: [&#39;cn&#39;, &#39;eq&#39;, &#39;ne&#39;]//comment out this out tp resolve error
            },
            searchrules: {
                required: true
            }
        },
        height: &#39;100%&#39;,
        serializeGridData: function (postData) {
            var propertyName, propertyValue, dataToSend = {};
            for (propertyName in postData) {
                if (postData.hasOwnProperty(propertyName)) {
                    propertyValue = postData[propertyName];
                    if ($.isFunction(propertyValue)) {
                        dataToSend[propertyName] = propertyValue();
                    } else {
                        dataToSend[propertyName] = propertyValue
                    }
                }
            }

            return JSON.stringify(dataToSend);
        }
    });
    jQuery("#UsersGrid").navGrid(&#39;#UsersGridPager&#39;,
    { add: false, edit: false, del: false, refresh: false },
    {},
    {},
    {},
    { multipleSearch: true, multipleGroup: true, afterRedraw: function () {
        $(this).find(".input-elm").triggerHandler(&#39;change&#39;, [true]);
    }
    });
    function displayButtons(cellvalue, options, rowObject) {
        var View = "&#60;a href="#" target="_blank"&#62;View&#60;/a&#62;";
        var Download = "&#60;a href="/Download/" target="_blank"&#62;Download&#60;/a&#62;";
        return View + Download;
    }
});</div></pre>
]]></description>
        	        	<pubDate>Thu, 12 Sep 2013 15:53:10 +0300</pubDate>
        </item>
</channel>
</rss>