asp.net mvc - Autoloading data when scrolling with jqGrid in MVC -


My problem is that while trying to implement the use of the Autoload feature, I receive the request to get it To try to load the next group of all data can not get to. The first initial load works fine

I tried to follow the example here

This feature is listed below under the item titled Left in Version 3.4 Listed on - Autologing while scrolling

What's the mistake here?

This is my JS grid code

  & lt; Script type = 'text / javascript' & gt; $ {Document} .ready (function () {$ ('# gvEmps'). JqGrid ({url: 'RecordEmpGrid', datatype: 'jason', colNames: [select 'training']], callmodel: [ Name: 'select training', index: 'training name', width: '300', align: 'left'}], line number: 15, scroll: true, line list: [10,20,30] pager : '#gvEmpsPager', sorted name: 'training name', viewer: true, sort: 'desc', jsonReader: {repeatitems: true,}, caption: ''});}); & Lt; / Script & gt;   

HTML

  & lt; Table id = "gvEmps" class = "SGrid scroll" & gt; & Lt; / Table & gt; & Lt; Div id = "gvEmpspager" class = "scroll" & gt; & Lt; / Div & gt;   

Controller

  // will never affect this action while scrolling, for the first time [HttpGet] public expressional record encoded on page load (string Sidx, string sound, int page, int lines) {var gr = new GridResult (sidx, sord, pages, rows); Var skip = rows * pages - rows; Datatile dt = faucet; (Var mr = new multiple records (product utility, "evaluate SQL")) {mr ["sql"] = "select * to tt. Training company WHERE company = 190 order training by ASC"; Dt = mr.GetDataTable (); } Gr total = dt.rows.Count; Var Records = New Multiror Records (DT); Strings (rows ["training name"]. String}};) (). (Line) ".} Return Jason (GR.Data, JasonUfest Behavior Alove Gate);}   

My Jason Cover Object

  Public Class GridResult { Private listing & lt; Object & gt; M_rowData = New list & lt; Object & gt; (); Private string m_order; Private string m_idx; Private jet m_rows; Private ind m_page; Public integer total {Received; set;} Public GridResult () {} Public GridResult (string sidx, string sord, int page, int rows) {m_idx = sidx; M_order = sord; M_pa Ge = page; M_rows = rows;} Public Zero AddDataRow (object [] column data) {m_rowData.Add (columnData);} Private object m_data; Public object data {get {return m_data ?? (M_data = BuildData ()); Return} return to the new object {id = id ++, cell = row}) in the safe object BuildData () {var id = 1; new {total = total, page = m_page ++, record = m_rows, rows = (m_rowData from row) ToArray ()};}}    

The problem was within my Jason Assistant object I blame poor naming conventions for I'm sorry, but it appears that I am recording & amp; Total Parameter Up

  Total = // Number of records of page records = // Total number of records that can be loaded with secure objects BuildData () {var id = 1; Page = m_page ++, records = total, // & lt; - New total number of total records possible to load (121) New {total = _rows, // & lt; In my case) select row = (new {id = id + +, cell = row}) from the row in m_rowData. ToArray ()}; }   

Switching both of them to solve the problem.

Here's a great link that leads me in search. This guy is a jqGrid master.



Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -