This is a migrated thread and some comments may be shown as answers.

[Solved] Can I custom paging on client side?

7 Answers 142 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Pam Redrum
Top achievements
Rank 1
Pam Redrum asked on 16 Nov 2009, 06:25 AM
I use OnDataBinding and OnRowDataBound events to make the data load as I want, but then I can't use the default paging on the Grid, How can I custom paging then?

7 Answers, 1 is accepted

Sort by
0
Accepted
Alex Gyoshev
Telerik team
answered on 17 Nov 2009, 06:28 AM
Hi Pam,

The paging requires that the total number of rows is known, therefore you should set the total property of the grid before data binding.

var grid = $('#Grid').data('tGrid');
grid.total = 50; /* or the total count of rows */
grid.dataBind(data);


I've prepared a demo, which you can view live. Trying it out requires a Facebook account - yet viewing the code does not require anything beyond a browser.

Greetings,
Alex
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Pam Redrum
Top achievements
Rank 1
answered on 17 Nov 2009, 08:28 AM
thank you for your help, I have found the same way but a little longer.

I use e.page for my Ajax paging by reading your js file  and grid.total, grid.databind, grid.pagesize are also help.
0
Sean Farmar
Top achievements
Rank 1
answered on 08 Dec 2009, 01:02 PM

a related question, same scenario(client side no server side code): in your demo you manpulate the detaset by passing in the "row range" in the api call(?)
is that the only way to do paging?
can the grid do it's own paging?

Sean
0
Atanas Korchev
Telerik team
answered on 08 Dec 2009, 01:16 PM
Hello Sean Farmar,

 Currently the grid cannot do its own paging. This means to supply all the data and the grid to extract only the current page. Right now the grid expects to receive a single page of data. However I think some JavaScript workaround can be implemented - for example paging the returned array before binding the grid.


Regards,
Atanas Korchev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Sean Farmar
Top achievements
Rank 1
answered on 09 Dec 2009, 08:42 AM

Atanas, thanks a lot for your help

 

Sean

0
Atanas Korchev
Telerik team
answered on 09 Dec 2009, 09:07 AM
Hi Sean Farmar,

 Find attached a sample project which shows how to make the grid page the data. It is based on our twitter bound example.


All the best,
Atanas Korchev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Sean Farmar
Top achievements
Rank 1
answered on 15 Dec 2009, 08:28 AM
Atanas, thanks a lot for that!

Sean
Tags
Grid
Asked by
Pam Redrum
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Pam Redrum
Top achievements
Rank 1
Sean Farmar
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or