0

We have a requirement where we have to bind thousands (Aprox 6K) of records to jqgrid, to avoid performance issues I have been told to use Pagination. So, the requirement is to write a stored procedure which can get 100 records each time (we can use offset and fetchnext), then I have to display these 100 records in jqgrid with the pagesize as 10 (e.g 100 records in slots of 10 or 20 ).

So, for this we need custom numeric pager for jqgrid with "previous 100", "Next 100" as buttons, on click of which we make a call to DB to fetch the data accordingly.

We are not so familiar with stored procedure, js, jquery, javascript. I have searched a lot but not able to understand how to achieve the exact implementation of above mentioned scenario.

Kindly provide your assistance.

Budhh
  • 153
  • 8
  • Which database you use? Which database engine you use? Which version of jqGrid and from which fork of jqGrid you use? You included "" tag. Do you really use [mvcjqgrid](http://stackoverflow.com/tags/mvcjqgrid/info) from [here](https://github.com/robinvanderknaap/MvcJqGrid) or you use some version of ASP.NET MVC with pure JavaScript jqGrid? – Oleg Aug 09 '16 at 21:10
  • "We are not so familiar with stored procedure, js, jquery, javascript" So, basically you are not familiar with anything you need ? There is an example of jqgrid with remote datasource here: http://www.guriddo.net/demo/guriddojs/loading_data/rest_million/index.html – Ozan Aug 09 '16 at 21:11
  • By the way you can test [the demo](http://www.ok-soft-gmbh.com/jqGrid/OK/performane-13-5000-25-free-jqgrid.htm), which demonstrates the performance of *local* paging, sorting and filtering of the grid with 13 columns and 5000 rows in case of usage 25 rows in the page. [Another demo](http://www.ok-soft-gmbh.com/jqGrid/OK/performane-13-40000-20-free-jqgrid.htm) uses 40000 rows. What I mean is that 6K could be still good for `loadonce: true` scenario. I recommend you to **test** the performance and implement solution with STORED PROCEDURES only is it's really required. – Oleg Aug 09 '16 at 21:16
  • we are using SQL server 2012, jqgrid version 1.9, installed from the nuget package manager. we are using jquery jqgrid – Budhh Aug 09 '16 at 21:18
  • @Ozan: You could find the base information and an example of paging in STORED PROCEDURES in [the old answer](http://stackoverflow.com/a/18299182/315935) – Oleg Aug 09 '16 at 21:19
  • jqgrid version 1.9 not exist. You mean probably jQuery 1.9 or jQuery UI 1.9. If the choice of jqGrid is not important for you I would recommend you [free jqGrid](https://github.com/free-jqgrid/jqGrid) 4.13.4 which I develop and provide for free. – Oleg Aug 09 '16 at 21:20
  • this is what we have asked to implement, so we have to do this way only as I explained in my question. Done with the basic jqgrid data binding, need help in how to proceed ahead. Written the stored procedure using OFFSET and FETCHNEXT.. – Budhh Aug 09 '16 at 21:23
  • How free fork of jqgrid, aka free jqgrid, could solve my purpose ? – Budhh Aug 09 '16 at 21:28
  • @Budhh: Could you answer on the questions which I asked you in my first comment. The usage of `OFFSET` and `FETCH NEXT` depend on the database which you use and from the version of the database. – Oleg Aug 09 '16 at 21:30
  • @Budhh: If you write I have program, which access database, it gives too few information. You can use different languages (C#, Java, ...), different databases (Microsoft SQL, MySQL, ...) and so on. In the same way you should specify more exactly what you do and which products you use. – Oleg Aug 09 '16 at 21:32
  • We are using microsoft SQL server 2012 as our database, and C# as programming language, MVC as design pattern, Currently they are using HTML table which takes too long to load in case of 5K data or more. Will it be the same in case of jqgrid? Please suggest. – Budhh Aug 09 '16 at 21:46
  • Oleg, I have seen the plugin developed by you .. its very extensive and with all the great feature but as my solution architect said not use any other thing then orignal JQGRID again I have started to check it by ealier way.. – Budhh Aug 11 '16 at 04:32

0 Answers0