Hi Ed
I've now overridden grid.processSort() as you suggested, but setting
self.CurrentRow does not change it's value.
I also tried changing it in GridAfterSort() method but no joy.
In the code below all 3 print statements print the same value when a
column heading is clicked, and the selected record remains the same as
before the sort.
You said earlier that it is by design that the current row remains
unchanged when the grid is sorted.
In my application the grid is used mainly as a lookup reference, and it
is more user friendly to go to the 'top' of the list as headings are sorted.
Thanks once again
Dave
-------------------------------- Code Extract
## *!* ## Dabo Code ID: productGrid
def processSort(self, gridCol=None, toggleSort=True):
super(self.__class__, self).processSort(gridCol=gridCol,
toggleSort=toggleSort)
print 'processSort currentRow', self.CurrentRow
self.CurrentRow = 0
print 'processSort After setting currentRow', self.CurrentRow
self.refresh()
def onGridAfterSort(self, evt):
print 'GridAfterSort currentRow', self.CurrentRow
self.CurrentRow = 0
Ed Leafe wrote:
> On May 20, 2008, at 10:56 AM, Dave Nation wrote:
>
>
>> I'm sorry to be so dull but you suggested :
>>
>> def processSort(self, gridCol=None, toggleSort=True):
>> super(<your grid class>, self).processSort(gridCol=gridCol,
>> toggleSort=toggleSort)
>> self.CurrentRow = 0
>>
>>
>> I don't know how to replace <your grid class> above.
>>
>> The grid in the CDXML has Name, RegID and code-ID all set to
>> "productGrid"
>> if I use self.Form.productGrid for <your grid class>, I get TypeError
>> Exception
>> and if I use dabo.ui.dGrid, I get an AttributeError Exception
>>
>
> I'd just use the generic __class__ attribute, which will always
> return the object's class:
>
> def processSort(self, gridCol=None, toggleSort=True):
> super(self.__class__, self).processSort(gridCol=gridCol,
> toggleSort=toggleSort)
> self.CurrentRow = 0
>
> -- Ed Leafe
>
>
>
>
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]