http://qs1969.pair.com?node_id=492604


in reply to Re^2: RFC : AJAX + DBI = DBIx::LiveGrid
in thread RFC : AJAX + DBI = DBIx::LiveGrid

Would it be possible include a hook or code_ref for a column to make transformations of the data simple? For example, you could imagine wanting to color certain fields red based on a value in the field. This could be easily done outside of your module context, but it might make a nice addition, since it would certainly streamline the process from DBI-->AJAX.

Sean

Replies are listed 'Best First'.
Re^4: RFC : AJAX + DBI = DBIx::LiveGrid
by jZed (Prior) on Sep 16, 2005 at 13:50 UTC
    Yes, I'll do that. I'll just wait for this first round of comments and then add that in to the release.

    update

    Acutally I am thinking it should be available as a hook in the Perl script but also as something that can be specified from the JavaScript end - e.g. add two optional arrays to the config in the HTML page for pre_column_txt and post_column_txt. E.g. if you want red around column two:
    var pre_column_txt = new Array(undef,'<span style="color:red">'); var post_column_text = new Array(undef,'</span>');
    How's that sound?

    update2

    Oh, I remember how it sounds :-). It sounds like an easy way to send cross-site scripting attacks. :-) Maybe I'll only do a hook after all. :-)
      I was thinking from the perl end, also. But I have to admit that my javascript is not up to snuff. Thanks for considering the addition. I am looking forward to the release.
      Sean