On Tue, 6 Oct 2009, skar wrote:

> Fritz Zaucker wrote:

>> Well, the API says that it expects an [][] ... that's what the current check
>> enforces. May be, the length check could be added to that.
>>
>> On the other hand, one could also allow a NULL parameter and use that for
>> resetting.
>>
>> But I think this should actually be consistent through all table models and
>> thus be decided by the Qooxdoo-gods ...
>>

> Well, the simple table does allow an empty array "[]" for setData.
> Perhaps smart table should also support it?

Or neither should support it. But I agree, that all the models should handle
this consistently. My feeling is, that an empty array is not a [][], but I
am not sure ...

I will make a separate post to the mailing list on that question, I think at
the moment it is buried too deeply in the SmartTableModel thread and might
not get the attention of the powers in charge ...

BTW, it might not be so trivial to allow an empty array in Smart.setData()
and just return if length==0. If you look at the code for setData(), you'll
see that there are several calls to routines updating indices, etc.

And note, there is also a call to __clearSelection()! So your previous
problem with the selection not being cleared is most likely not a bug, but
caused by you returning from setData() before this line is reached?

> Also, when I set data, it doesn't raise a "dataChanged" event like the
> simple table. Maybe smart table should call the super class method too,
> that way you don't need to write logic which is already written in simple
> table? Just my 2 cents :)

My (Fritz') contribution to the SmartTableModel is just this
(new/additional) check for the rowArr parameter to various functions (so
this is entirely my fault ...) and the SearchAsYouType demo.

Everything else I'd rather leave to Dave to comment on.

> Also, in the demo at
> SmartTableModel/trunk/demo/searchAsYouType/source/class/smart/searchAsYouType/Application.js,
> the view "All" isn't used when the search field is empty. I think using it
> at line 132 like this would be optimal:
>>
>> this.debug('timer fired');
>>           this.__searchTimer.stop();
>>           if(this.search_field.getValue() == ""){
>>             this.debug("Empty search field, showing all rows ...");
>>             tableModel.updateView(this.views["All"].id);
>>             tableModel.setView(this.views["All"].id);
>>           } else {
>>             this.debug("Showing rows matching search field ...");
>>             tableModel.updateView(this.views["SearchAsYouType"].id);
>>             tableModel.setView(this.views["SearchAsYouType"].id);
>>           }
> Now, there's no search happening if the search field is empty, except
> for the initial view computation at line 239 of Smart.js.

Yes, I will update the demo as you suggest. I am not sure if update of the
"All" view is necessary at all.

Cheers,
Fritz

-- 
Oetiker+Partner AG              tel: +41 62 775 9903 (direct)
Fritz Zaucker                        +41 62 775 9900 (switch board)
Aarweg 15                            +41 79 675 0630 (mobile)
CH-4600 Olten                   fax: +41 62 775 9905
Schweiz                         web: www.oetiker.ch

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to