My current Perl Ironman Challenge status is: My Ironman Badge

Monday, November 16, 2009

Datagrid

For those of you who have hacked in other languages, you know how easy it is at time to just display a grid of data (either to the user via the web or with a desktop application). Sadly, there isn't any as cohesive for Perl and Catalyst. And I really need one for the project I have at work. So this next week I am aiming to build one. The underlying tools will be Catalyst::Controller::DBIC::API, along with Template::Declare (specifically Catalyst::View::TD), using jquery plugins Collections and JSON-REST for the front end.

The premise is rather simple. Subclass one of the DBIC::API's concrete implementations (REST), provide an index end point that forwards to a TD view that spits out the grid. From then on, the javascript in the grid will actually manage the data via the REST api. To make customization easier, the grid, each "row" and each element in a row will have their own TD class. A helper script will be written that will generate these to subclass from the distributed classes to enable customization.

The goal is to provide four things: Controller that subclasses DBIC::API, Views that implement the grid and it's functionality, the ability to, within the Perl code, provide overridden behavior for all of the functionality of the grid (ie, methods on the TD classes that spit out the right javascript), and a helper class that makes it as painless as possible to expose a table via the datagrid in your application.

My hope is that with these four things in place, we'll have a coherent distribution with this functionality bundled (including the javascript) and people can stop reinventing this wheel and instead improve this one. We'll see how it goes.

3 comments:

  1. +1 from me on this idea, it should be super-handy.

    Just remember the golden rule for doing this sort of thing, the look and feel should be as close as possible to Excel :)

    ReplyDelete
  2. +1 too. I think I've searched CPAN at least 3-4 times in the past looking for something like this and have never found one.

    ReplyDelete
  3. I am looking for something like this. Did you get done? Did you release somewhere? Do you need help with anything?

    ReplyDelete