asp.net mvc 4 - Data is not retrieved in infragistics iggrid when data binding is called from another page -
here scenario bulding asp.net mvc web application
i have webpage page.aspx
contains infragistics iggrid. initialized as
$.ig.loader(function () { $("#listinggrid").iggrid({ primarykey:"code", autogeneratecolumns: false, responsedatakey: "data.d", columns: _data, features: [ { name: "groupby", }, { name: 'paging', pagesize: 10, type: "remote", recordcountkey: "data.totalrowcount", pagesizeurlkey: "pagesize", pageindexurlkey: "curpage" }, { name: "sorting", type: "local" }, { name: "summaries", type: "local" } ] }); });
and getting data in grid on button click this
$("#showrecords").click(function () { var url = "/main/grid?tbname=" + parameter; var jsonp = new $.ig.jsonpdatasource({ datasource: url, paging: { enabled: true, pagesize: 10, type: "remote" } }); $("#listinggrid").iggrid("datasourceobject", jsonp).iggrid("databind"); });
this working fine should work
but i have page child page of page.aspx search.aspx
in trying bind data same way this
$("#ok").click(function () { var url = "/main/grid?tbname=" + parameter + "&_query=" + query; var jsonp = new $.ig.jsonpdatasource({ datasource: url, paging: { enabled: true, pagesize: 10, type: "remote" } }); window.parent.$("#listinggrid").iggrid("datasourceobject", jsonp).iggrid("databind"); });
but url call not going controller side
here contoller
public actionresult grid(string tbname, string _query, int pagesize, int curpage) { res = mvcapplication.dbm.sqlquery(_query).tolist(); var jsondataobj = json(new { responsedatakey = "d", currentrecords=skip+top, _skip=skip, _top=top, totalrowcount=_totalrowcount, d = res }); return json(res); }
for page.aspx
call going controller databinding search.aspx
not calling.
plz wrong or better way it. in advance
it looks child page missing setting pageindexurlkey. default datasource going use key of "page" since controller accepts property named "curpage" instead you'll have make sure key set whenever implementing paging , calling controller.
Comments
Post a Comment