filteringtable
FilteringTable (programmatic)
Posted June 25th, 2007 by achilleanJSON Object to FilteringTable
Posted June 20th, 2007 by mailarchiveJayaram Krishnaswamy wrote:
Yes. The store is the repository of the data that is displayed by the
FilteringTable.
Thus they are essentially a single unit in this context. By manipulating
the store
you are causing changes to be reflected in the table.
The setData() and addDataRange() methods are the most efficient when dealing
with multiple updates. If a single object is changed then use the addData()
method
to add the object or replace it if there is already an entry with the same
key.
You can use the update() method to update a single field within an element
if that
is all that changed.
All these Store methods invoke events that cause the FilteringTable to
update the
view accordingly. Thus a sequence of single addData() calls will cause 'n'
events.
A single addDataRange() call will cause 1 event. Hence the greater
efficiency.
There is a case for 'chunking' of range updates to maintain UI
responsiveness but
that is something that is usually discerned on a case by case basis.
HTH
Ross.
--
View this message in context: http://www.nabble.com/Re%3A-JSON-Object-to-FilteringTable-tf3158017.html...
Sent from the Dojo mailing list archive at Nabble.com.
(Unofficial) FilteringTable enhancements
Posted June 20th, 2007 by mailarchiveWhile 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 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:
...
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
--
View this message in context: http://www.nabble.com/%28Unofficial%29-FilteringTable-enhancements-tf302...
Sent from the Dojo mailing list archive at Nabble.com.
FilteringTable double click
Posted June 20th, 2007 by mailarchiveIn setting up the double click events for a Filtering Table
programmatically, how come this works:
dojo.event.connect(row[i], "ondblclick", BuildCodes,
"rowSelected");
but this doesn't:
row[i].ondblclick = BuildCodes.rowSelected;
where row[i] is the row of the FilteringTable that I'm working with.
Are they not programmatically equivalent?
Matthew Engel
Senior Programmer/Analyst
State University of New York at Stony Brook
mengel@notes.cc.sunysb.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dojotoolkit.org/pipermail/dojo-interest/attachments/20061215/9134...
Clearting Out and re-populating filteringtable
Posted June 20th, 2007 by mailarchiveHi, just a quick question - if i want to re-use a filteringtable widget with
a different dataset [ potentially different columns and rows ] - how do i
clear out the columns ?
I've tried filteringtable.store.clearData();
but this throws an error -> jojo.html.setClass() failed [TypeError: node has
no properties, file: http://auroradev.net/dojo/dojo.js, line: 4679]
code fragment below:-
populate: function(data){
var rows = data["rows"];
var columns = data["columns"];
this.fTable.store.clearData(); // if removed, then columns don't reset -
left in produces error
this.fTable.valueField = data["key"];
for (var x = 0; xhttp://www.nabble.com/Clearting-Out-and-re-populating-filteringtable-tf2...
Sent from the Dojo mailing list archive at Nabble.com.
Adding a filterer to FilteringTable widget
Posted June 20th, 2007 by mailarchiveHello,
I'm wondering if there are any examples available of adding filterers
to the FilteringTable widget. I'd like to be able to show/hide rows on
based on input received via text box.
Thanks,
MJH
Dojo Forum