0

I am working jqgrid pagination .And stucked at a very basic problem but it is really irritating me. There are two main aspects of what i am doing. 1. Server side pagination for server side data. 2. Client side pagination for server side searching

  1. In 1st case i am fetching 50 records for every pager button(next,previous,last,first) and also if user enter page number then also correct service call is fetching perfect 50 records for me and setting data. Also as per my requirements i want jqgrid to show total records on the server at the bottom-right side of grid even if grid contains only 50 at current and accordingly total pages should get updated. this is also working properly. 1841 is number of records on server but in jqgrid there exists only 50 records .On click of next i am calling service to get next set of 50 records

  2. Actual conflict is here .If i search with some criteria service will return me whole data for search say 300 records. Now all the 300 records are fetched in single service call. So i want client side pagination for this .I am able set 300 records and page number also but view {} to {} and page number in textbox at the center does not get updated. Is there any way to reset the value of page textbox and view{} to {} to default value ? Please help enter image description here This is a image when data is fetched through search so 50 records are returned.So records are updated to 50 and pages are 1. But textbox value is set to 37 and view 1801-1850 0nly.Ideally it should be page 1 and view 1 to 50 Please help on this

4

1 に答える 1

1

totalpageおよびrecordsサーバーの応答に間違った値を投稿したようです。と の値を入れ替えたとしrecordsますtotal。の値は、データセット内totalの総ページ数である必要があります。の値はrecords、データセット内の行 (レコード、アイテム) の数でなければなりません。サーバーコードを調整して、データを正しい方法で取得 (計算) するか、サーバーから返されたデータから取得するかを指定する必要がjsonReaderあります。totalpagerecords

回答を読んで、 jqGrid が追加のパラメーターをサーバーに送信する理由と、サーバーが返す必要がある理由を理解することtotalをお勧めします。pagerecords

于 2013-04-12T06:41:11.587 に答える