« Return to Thread: (Unofficial) FilteringTable enhancements

Re: (Unofficial) FilteringTable enhancements

by Sasha Firsov :: Rate this Message:

Reply to Author | View in Thread

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ross,
The FilteringTable enhancements are the feature which I desperately need
and have resolved in fast, but weird ways. Your solution is elegant.

But it looks like it comes to nowhere. I have an proposal for you.
There is few ways of improving functionalities of widgets/package.
- - custom code for each occasion(mine)
- - patch( which you are proposing )
- - inheritance/ child widget
- - run-time patch. i.e. in
http://dojotoolkit.org/pipermail/dojo-interest/2007-January/023651.html

I do not know is term "run-time patch" exist.
Is anything like that around?

Seems it is not standardized, but I like the idea. From one side, it
keeps original widget and code untouched, from another gives extension
functionality by including patch JS file to HTML.

Some patching security, versioning and future integration compatibility
could be added on top. Like warning if new methods for some reason
already exist in widget(i.e. been accepted in main branch), but do not
match.

What do you think about making such "runtime" patch for your
FilteringTable enhancements?
I bet, it would be more thankful users than me :)

Thank you,
Sasha

PS. Dojo guys, such model also could be an extra step before applying
feature in core. So feature could pass full user review before integrated.


Ross Thomas wrote:

> While I await the new Dojo CLA text I am making the following
> unofficial enhancements to the FilteringTable available.  I have seen
> several cases in the list recently that would have benfited from these
> capabilities.
>
> Attached are three patches that cover two enhancements to FilteringTable.
> The two enehancements are:
>
> 1) Distinct rendering functionality.
> ====================================
> This allows for the specification of a function that provides rendering of
> the column's value in a way analogous to the 'sortUsing/sortFunction'
> capability.  Thus a Number like '100.0' which currently can only be rendered
> as '100' could be rendered as '100.00' in blue text as a link and still be
> sortable by the table since it is still represented as a Number in the data
> store.
>
> In a similar vein, a boolean value could be represented as a CheckBox
> with the 'selected' attribute set according to the current value of the
> data.  Thus by updating the value in the data store, the checkbox will
> change accordingly.
>
> The render function is called as:
>    function(cell, meta, val, src)
> where:
>    cell is the <TD> element for the current value
>    meta is the column description data (aka table.columns[index])
>    val is the actual value from the data store
>    src is the original JSON data (or parsed HTML data) for the row
>
> The presence of 'src' allows for rendering based on other values in the row.
>
> The return value of the function is a string suitable for insertion as the
> 'innerHTML' value of the cell.
>
> To specify the render function use either the HTML tag method:
>
>    <TH .... renderUsing="myRenderFunc" ...>...</TH>
>
> or the programmatic method in the column spec:
>
>    var myColumn = {
>       ....
>       renderFunction: myRenderFunc,
>       ....
>    };
>    table.columns.push(table.createMetaData(myColumn));
>
>
> 2) Benign handling of 'null' data.
> ==================================
> This patch allows for null values to be treated as minimal values in a sort
> and also to have them displayed as empty cells by the default rendering
> engine.
>
> Thus a Date column with a null value will not display as "01/01/70" or
> "NaN/NaN/NaN".  Instead it will display as an empty cell.
>
> In an ascending sort all null values will be at the top of the cloumn.
> Similarly, for a descending sort all null values will be at the bottom.
>
> Contents
> ========
> The attached zip file provides patches and source files for the two
> functionalities distinctly and combined.  These patches and files are
> relative to the 0.4.1 release.
>
> A patch for the nightly builds can be provided as needed/requested.
>
> Hope this helps others as much as it has helped me.
>
> Ross.
>
> Attachment:  http://www.nabble.com/file/5673/FilteringTable.zip
> FilteringTable.zip

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFtjmYVSSUoWsWyI8RAhH5AKCCJWQgMTjWXZKLMCIh6IKT8Ad5DQCeMjSA
HrVwZV7TitoW6hcXIcheOxk=
=tkXn
-----END PGP SIGNATURE-----

_______________________________________________
Dojo FAQ: http://dojo.jot.com/FAQ
Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
Dojo-interest@...
http://dojotoolkit.org/mailman/listinfo/dojo-interest

 « Return to Thread: (Unofficial) FilteringTable enhancements