The LiteGrid jQuery Grid plug-in is getting some new code as I drive towards the 1.0 release.  I’ve (finally) started on an MVC library to make working with LiteGrid within MVC applications trivially-simple, I’ve created a sample application to serve as live documentation, and a variety of NuGet packages will be part of the 1.0 release.  If you want to know more, read on.

What is LiteGrid?

As a refresher, LiteGrid aims to be an easy-to-rich grid extend plug-in that plays very nicely with ASP.NET MVC.  The JavaScript core is built using an event-driven, pluggable architecture that makes it easy to add or alter behavior by composing modules together.  Out of the box, it supports:

  • AJAX-based data provider supporting retrieval, updates (both multi-row batch and single-cell modes), updates, and inserts, with full support for retrieving and rebinding database-populated values post insert/update (more on this in a future post)
  • Batch saving module that allows users to persist their changes on-demand
  • BlockUI integration, nicely disabling access to the grid during data operations
  • Cell saving module that automatically saves changes whenever a cell is edited
  • Formatting module that allows you to specify anything from simple to advanced formatting rules
  • Editable via integration with JEditable
  • Layout manager that adds resizable columns, fixed header row, and more
  • Integration with jQuery UI
  • Row addition module that does exactly what it sounds like
  • Row deletion module that adds a delete button to all rows
  • Injection protection through escaping potentially dangerous characters, and unescaping them prior to edit
  • Dynamic row striping that maintains the correct striping even as the grid changes
  • Toolbar that supports custom buttons
  • Tree-grid functionality, allowing rows to be nested under other rows
  • Client-side sorting, even when the tree-grid module is used.

An easy-to-extend JavaScript programming model is only one of the goals I had for LiteGrid though.  The other goal was to make something that played very nicely with ASP.NET MVC.  This is an area where other jQuery grids disappoint.  Unfortunately, I really fell short of my original goal.  Though I highlighted many of the MVC-related classes I wrote, I never actually released any of the helpers I made for working with LiteGrid.  But that’s all going to change.

Towards 1.0

Thanks to the persistent reminders via E-mail, I’ve once again made LiteGrid a priority, and I’ll be working towards a 1.0 release later this month.  The 1.0 release will include a library of MVC classes (HTML helpers, ActionResults, etc) as well as a sample MVC 3 application that shows how to use LiteGrid.  I’ve just committed the first step towards this release to source control, so if you’re curious or can’t wait for the official release, feel free to check out the code.  There’s already a partially working sample application with a basic example of how to move data to/from LiteGrid and an MVC 3 application.  I’ll continue to flesh that sample out as the MVC library grows and things inch towards the 1.0 release.

What else is coming in the 1.0 release?  That’s a very good question.  In addition to MVC-specific helpers, I’m planning on doing a cleanup pass through the LiteGrid JavaScript and reducing the amount of code that’s needed for common scenarios (right now, you have to explicitly initialize each module you want to use, even the really common ones like row stripping).  1.0 will also ship with probably 3 NuGet packages: one for the core JavaScript library, one for the MVC library, and one for the sample application. 

Contributors Wanted

It’s very difficult to stay motivated on your own.  I think there’s huge potential for LiteGrid, especially within the ASP.NET MVC space, and I’d love for others to step in and help it realize that potential.  If you know JavaScript and/or MVC and would like to help out, please contact me. 

If there are other features people are interested in seeing for 1.0, please let me know, and I’ll do my best to include them.  In the meantime, look for future posts to highlight some of the things that are happening to the codebase as it moves towards the 1.0 release. 

(Oh, and I haven’t forgotten about Fluently-XML either.  The final post in that series as well as the source code release are both in the works.)