You should strongly consider migrating to the Smart table model contrib. I
wrote it exactly because the problems with Filtered were not easily fixable
with simple workarounds and patches to the code. That said, the Smart table
model is derived from Filtered in concept, and should be a drop-in
replacement for Simple. You will have to adapt your use of filtering to the
different API that Smart offers. The Smart model code is reasonably well
documented, and Fritz Zaucker and I can help you figure out how to use it if
need be.
I can't speak for the QooxDoo team, but my guess is that Smart will
ultimately replace Filtered as there has been almost no activity on Filtered
bug fixes in the past long while... and Smart addresses all the Filtered
issues currently logged in the QooxDoo bugzilla.
Probably not what you wanted to hear, exactly, but that's my advice...
Dave
danovics wrote:
>
> Hi Stefan
>
> A new day a new issue.
> So the situation for now:
> I have a for row long table (filtered model) with two columns. For
> example:
>
> true, item1
> true, item2
> false, item3
> false, item4
>
> And I have 3 buttons: Show all, Checked, Unchecked.
> After init the table is in Sholl all state.
> Thanks to your modification code when in Shaw all state I change the value
> of checkboxes everything just works fine.
>
> But:
> When I change a cb value in filtered view (when I see only table rows in
> which the first cell contains only unchecked or checked checkboxes) the
> mechanism go broke. Because after this change the tableModel will contains
> only the visible rows and forget the filtered-out ones.
>
> Here is my code for the cellClick event, where I change the chekboxes
> value:
> <code>
> table.addListener("cellClick", function(e) {
> if (e.getColumn() == 1) { // if clicked cell is in the
> first column change checkbox
> var selectedRowIndex, selectedRowData
> selectionModel.iterateSelection(function(index) {
> selectedRowIndex = index;
> selectedRowData = (tableModel.getRowData(index));
> });
> if (selectedRowData[1] !== null) { // if the cell
> contains checkbox
> var newTableModel = [];
> var newRowData = [[selectedRowData[0],
> !selectedRowData[1], selectedRowData[2]]];
> tableModel.setRows(newRowData, selectedRowIndex);
> }
> }
> });
> </code>
>
> I wonder if there is a possibility to manipulate tableModel in filtered
> state without data loss.
>
> Greetings
> Daniel
>
>
> Stefan Volbers wrote:
>>
>> Hi Daniel,
>>
>> I'm not very surprised that this doesn't work, as the addRow() etc.
>> methods don't get overridden in Filtered.js.
>> The filtered model keeps an array of the complete (unfiltered) model
>> data; this is saved correctly only if you apply it with setData() (as
>> only this setting method is overridden in Filtered.js). Having the model
>> save the model data is essential for what you want to do.
>>
>> I'd still like to know if my proposed patch would remedy the issue. So I
>> suggest you retain your original application class (using setRows()) and
>> create a custom model class which inherits from model.Filtered (say,
>> Filtered2; remember to call this.base(arguments) in the constructor).
>> Have it override setRows() with the three lines of code in my earlier
>> mail, and let your application use the new custom filtered model.
>>
>> After a ./generate source your application should no longer forget the
>> data in question.
>>
>> Shouldn't be too much hassle to test this, and if you succeed, we could
>> file a bug report to get this issue done.
>>
>> Greetings,
>> Stefan
>>
>> qooxdoo-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>>
>
>
--
View this message in context:
http://n2.nabble.com/filtered-table-with-checkboxes-problem-tp4050308p4057699.html
Sent from the qooxdoo mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel