Hi Derrell,

On Tue, 24 Nov 2009, Derrell Lipman wrote:

> On Tue, Nov 24, 2009 at 07:47, Fritz Zaucker <[email protected]> wrote:
>
>> Hi Qooxdoo gods,
>>
>> the simple table model has a method setSortMethods(). However, it is
>> missing the matching getSortMethods() method.
>>
>> As the sort methods are stored in a private variable (__sortMethods), it
>> is not possible to access the sort methods in a class extending
>> qx.ui.table.model.Simple. Currently the contributed Smart table model is
>> not fully functional for this reason.
>>
>> Would it make sense to
>>
>> a) make __sortMethods protected instead of private
>>
>> or
>>
>> b) add a getSortMethods() method?
>>
>> I'd be willing to provide a patch for either of these variants, please
>> advice which you'd be willing to include into the code base ...
>>
>
> Option (b) sounds appropriate. I agree there should be a way to retrieve
> what has been set, although I've never had a need for such thing.

I also think that (b) is more appropriate than accessing protected variables
in the derived class.

> It's all done programatically (by the developer) in nearly every case, so
> the developer should know what has been set.

Fact is, that the Smart table model contribution (which extends the simple
table model) currently tries to access this.__sortMethods. This fails in the
build version as the private names are optimized "away".

As far as I understand from Smart.js there is some need to "know" the sort
models set on the table model to preserve the sorting across filtering of
the table rows. I am not sure if this goal could be achieved without
"knowledge" of the sort functions, but I doubt it.

> In fact, because of that, I'd almost prefer that the getSortMethods()
> method be added as a mixin.

If the above argument doesn't convince you, the mixin would be ok for me
too, I'd just like to fix/use and perhaps improve Smart.js without having to
patch Simple.js ...

> I suppose it's small enough that it could be directly included in the
> Simple model, but enough small things add up to something big so I'm
> always thinking about how much use something will get before directly
> adding it to a class.

As an getSortMethods() method would be implemented right next to the
setSortMethods() method in the source file, it seems more likely to get
adapted to whatever internal changes might occur in Simple.js in the future.
And if I don't overlook something, it would be basically a three-liner

   getSortMethods: function() {
       return this.__sortMethods;
   }

plus some lines of documentation.

So from a maintainenance point of view I'd vote for inclusion of a method in
Simple.js.

The most important issue for me would be, to have this solution included
into the framework itself, rather than having yet another contribution that
has to be tracked/maintained/installed separately.

I am not sure who is in charge of the table code,

> Derrell

you seem at least to know a lot about it.

If you can let me know how to proceed I'd be very grateful.

Thanks and best regards,
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

------------------------------------------------------------------------------
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

Reply via email to