Friday, 15 August 2014

asp.net mvc - Paging not working when loadonce:true in jqGrid -


The property in jqGrid is loadonce: true , so I'm getting the first page record only And how to get a third page record.

Code:

  $ (function () {$ ("# pendingAppgrid") JqGrid ({colNames: ['name', ' Email '], colmodel: [{name:' name ', index:' name ', sortable: true, align:' left ', width:' 200 ', editable: false,' text ', search: true} (Name: 'email', index: 'email', sortable: wrong, align: 'left', width: '200', editable: incorrect, edit: 'text' (name), line number: 15, Line list: [10, 20, 25], sortorder: "desc", height: 345, ignore: true, viewer: true, rownumbers: true, caption: 'pending approval', width: 660, url: @ Url.Content ("~ / Home / PendingAprprovals"), Day Ataip 'Jason', Maitip: 'GET', Lodns: true}) jQuery ( "# pending upgrade"). JqGrid ( 'filterToolbar', {searchOnEnter: true, enableClear: false});}); Public functioning vertical transplantation (int page, int rows, string sidx, string sound) {// See Return (GetPendingApprovals ()); Int turn page = convert toInt32 (page) - 1; Int total drill = 0; & Lt; ViewModels.Channel.UserChannels & gt; LTemChannel = new list & lt; ViewModels.Channel.UserChannels & gt; (); & Lt; ViewModels.Channel.UserChannels & gt; LstChannel = new list & lt; ViewModels.Channel.UserChannels & gt; (); LTemChannel = GetPendingAprprovals (); Foreign currency (see Models.Channel. Euttered Channels in LAM channel) {ViewModels.Channel.UserChannels channelWithLogo = New ViewModels.Channel.UserChannels (); ChannelWithLogo.ID = cha.ID; Channel Vitholao. Name = Chay. Name; Channel with logo Email = Ch.Email; LstChannel.Add (channelWithLogo); } Kulrex = lstChannel.Count; Var totalPages = (int) Math.Ciling (total vacancies / (float) rows); LstChannel = lstChannel.ToList & lt; ViewModels.Channel.UserChannels & gt; (); IPagedList & LT; ViewModels.Channel.UserChannels & gt; IlstChannel; Switch (sord) {case "desc": ilstChannel = lstChannel.OrderByDescending (m = & m; m.Name). ToPagedList (Pages, Rows); break; Case "Esk": ILSTChannel = lstChannel.OrderBy (M => m.Name). Tofed list (pages, rows); break; Default: ilstChannel = lstChannel.OrderBy (m = & m; m.Name). ToPagedList (Pages, Rows); break; } Var data = ilstChannel; Var jsonData = new {total = total page, page, record = total vacancies, rows = (select data from new to id {id = m.ChannelID, cell = new object [] {m.Name, m.Email} }). ToArray ()}; Jason returned (Jessandata, Jansenweivest Behavior, Elove Gate); }   

Here I'm just getting the first page record. I have more pages Search functionality is working properly The problem is that I am only the first page record. No other page record is available. How can I get another page record please

If you use loadonce: true then replace the jqGrid datatype after the first load of data from the grid ' Local 'parameter for all next grid reloading (sorting, paging, filtering C) local work if you want to refresh the grid data to the server, so once you Detaat should set your original values ​​( ' json ' or 'xml'). For example:

  $ ("# pendingAppgrid"). SetGridParam ({Data Type: 'Jason', pg: 1}). Trigger ('reload grid');   

Please see the jqGrid options for more details.

No comments:

Post a Comment