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

Sorting from client Javascript

15 Answers 217 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jay
Top achievements
Rank 1
Jay asked on 16 Mar 2008, 06:58 PM
Is there  way to sort the grid columns using a client-side Javascript call without POSTing back to the server?

15 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 18 Mar 2008, 08:58 AM
Hello Jay,

You can use the sort client side function to handle this task. However, this would cause the control to be rebound, thus a call will be made to the server. You can couple this behavior with Ajax, however, to simulate client side performance.
I hope this information helps.

Best wishes,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Markus
Top achievements
Rank 2
answered on 05 Jun 2008, 07:21 AM
Is there a way to enabled clientside sort by default ?
Like setting a property or something?
0
Sebastian
Telerik team
answered on 05 Jun 2008, 07:29 AM
Hi Markus,

Client-side sorting is not supported in the present version of RadGrid. You can consider the solution explained by my colleague Yavor as a possible workaround.

In addition, you may be happy to know that for the next version of RadGrid for ASP.NET AJAX (expected at the end of July) we will introduce a variety of client-side capabilities (sorting, editing, filtering, etc.) which you may find useful. For more info please review the series of blog posts by my colleague Vlad on our site:

http://blogs.telerik.com/VladimirEnchev/Posts.aspx

Kind regards,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Nicholas Walker
Top achievements
Rank 1
answered on 24 Sep 2008, 06:39 PM
The Q2 2008 version of ASP.NET AJAX still does not appear to have client side sorting for Grid.  Is that the case?  If so, are you still planning to roll out this funcitonality?
0
Vlad
Telerik team
answered on 25 Sep 2008, 06:56 AM
Hello Nicholas,

You can use the grid client-side data-binding to achieve this. Please check also this blog post for more info about how to cache your requests:
http://blogs.telerik.com/VladimirEnchev/Posts/08-09-19/How_To_Telerik_RadGrid_client-side_caching_with_client-side_binding_to_web_services_using_LINQ_to_SQL.aspx

Best wishes,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Nicholas Walker
Top achievements
Rank 1
answered on 26 Sep 2008, 09:31 PM
After working on this all day, I finally got the binding to a web service working.  However after getting this far, I have discovered that the values returned from the WebMethod function do not bind properly if the DataKey is not actually tied to a displayed column in the grid (ie, an ID column).  So while everything else gets sorted correctly, the ID columns stay with their original rows in the grid.  Am I missing something here or is this a bug?

--nick
0
Rosen
Telerik team
answered on 30 Sep 2008, 06:19 AM
Hi Nicholas,

Can you please give us little more details about your scenario and implementation, such as RadGrid's declaration and how it is populated with data? If you can send us some code snippets or small runnable project (attached to a formal ticket) will be highly appreciated. Thus we will be able to gather more details about your case and give you more-to-the-point answer.

Greetings,
Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Kevin Castle
Top achievements
Rank 1
answered on 01 Dec 2008, 10:39 PM
In the latest Q3 release do you have to rebind the data in order to achieve the client side sorting or can you simply set a property which would allow the rows to be sorted correctly?

Doesnt this functionality work with server side binding without having to rebind the data?
0
Crescent
Top achievements
Rank 1
answered on 02 Dec 2008, 03:25 AM
I find it amazing that telerik has left this most basic of client-side features out. Client-side sorting of tabular data is not for everyone (at least not for anyone with large datasets), but it's pretty common now, even just as a simple "hey look we can do it too" thing. It's annoying that a postback/client-side data fetch has to happen just for sorting, when it can easily be done in the client.
0
Kevin Castle
Top achievements
Rank 1
answered on 02 Dec 2008, 11:16 PM
Original Post:
"Is there a way to enabled clientside sort by default ?
Like setting a property or something?"

Telerik Reply
"Client-side sorting is not supported in the present version of RadGrid. You can consider the solution explained by my colleague Yavor as a possible workaround.

In addition, you may be happy to know that for the next version of RadGrid for ASP.NET AJAX (expected at the end of July) we will introduce a variety of client-side capabilities (sorting, editing, filtering, etc.) which you may find useful. For more info please review the series of blog posts by my colleague Vlad on our site:"

When will this feature be completed as the original post had requested.
If we need to go back to the server to rebind the data, when doing client side databinding and client side sorting, then I would say that this feature has not been completed.
Can you please give us an ETA when this will be working in an upcoming release????!!!
Of if you have a work around for this, which could achieve client side sorting without rebinding, please share with us!

Thank you.
Kevin.


0
Vlad
Telerik team
answered on 03 Dec 2008, 07:03 AM
Hello Kevin,

Since the grid have client-side caching the grid will not request the server if the data for the current state are retrieved. You can check this demo for more info:
http://demos.telerik.com/aspnet-ajax/Grid/Examples/Client/Caching/DefaultCS.aspx

Also you do not need to request any server if you have your data on the client already. Just set data source and call dataBind():

var tableView = $find("RadGrid1").get_masterTableView();
tableView.set_dataSource(yourData);
tableView.dataBind();

All the best,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Kevin Castle
Top achievements
Rank 1
answered on 04 Dec 2008, 08:03 PM
From my previous post. This question was not answered:

"When will this feature be completed as the original post had requested.
If we need to go back to the server to rebind the data, when doing client side databinding and client side sorting, then I would say that this feature has not been completed.
Can you please give us an ETA when this will be working in an upcoming release????!!!
Of if you have a work around for this, which could achieve client side sorting without rebinding, please share with us!"



Also :

"Since the grid have client-side caching the grid will not request the server if the data for the current state are retrieved. You can check this demo for more info:
http://demos.telerik.com/aspnet-ajax/Grid/Examples/Client/Caching/DefaultCS.aspx

Also you do not need to request any server if you have your data on the client already. Just set data source and call dataBind():"

Does this mean that if we cache the data , via client side, then we will not have to support sorting the data on the server? It will just work automatically. Note: We are not using Declarative client side binding.
0
Sebastian
Telerik team
answered on 05 Dec 2008, 09:44 AM
Hi Kevin,

If you use client-side caching as my colleague Vlad suggested, the server will be requested only on initial load and for all subsequent operations the source data will be retrieved from the cache and then the sorting/paging/filtering operations will take place.

Without caching enabled the grid will be bound on the client and each operation will be processed asynchronously (through PageMethod or WebService for example) and the results will be retrieved on the server and passed to the client to refresh the grid data client-side.

I hope this explanation is helpful. Let me know if I am leaving something out.

Regards,
Sebastian
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Kevin Castle
Top achievements
Rank 1
answered on 05 Dec 2008, 04:48 PM
Thank you. That was a perfect explanation.

Do you guys have the limitations of your grids client side databinding documented somewhere?
I keep having to post in the forums, get multiple responses, in order to figure out that client side databinding doesnt support X, or Y, etc. Its a very exhausting process.
0
Pavel
Telerik team
answered on 09 Dec 2008, 06:56 AM
Hello Kevin,

Unfortunately there is no list of the client-side binding currently. We will try to improve our documentation in this regard in the future.

Greetings,
Pavel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Jay
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Markus
Top achievements
Rank 2
Sebastian
Telerik team
Nicholas Walker
Top achievements
Rank 1
Vlad
Telerik team
Rosen
Telerik team
Kevin Castle
Top achievements
Rank 1
Crescent
Top achievements
Rank 1
Pavel
Telerik team
Share this question
or