Pages

Thursday, January 28, 2010

JQuery DataTables

I've recently been working on an MVC.NET project. Whats interesting is that most WebForms User controls don't work because there is no post back and code behind. (Don't quote me on this, I'm still very new to it).

So anyway, I needed a table that could Sort Columns, Search Filters, Paging... I conveniently found some JQuery Tables that work on HTML Tables.  See http://www.datatables.net/.

My solution built in MVC is to have a model of the data, and have the view output the model using HTML tables.  This is done in ASP.NET so you use angle brackets inside the asp code to loop through all the entries.  Then you use the above jquery library, which is completely client side, no server side calls.

The downside is, you retrieve all your data the first go, and load the entire table, which is slower than real paging.
Reblog this post [with Zemanta]

1 comment:

Jason said...

You can do server-side processing to only load the data you need per page. Take a look at http://www.datatables.net/usage/server-side. All the best!

Post a Comment