Clicking on a TsBrowse Column, can it execute a Function?

Post Reply
Jules de Pierre
Posts: 21
Joined: Mon Mar 20, 2006 12:48 pm
Location: Netherlands

Clicking on a TsBrowse Column, can it execute a Function?

Post by Jules de Pierre »

Can I implement a function when clicking on the top of a column in a TsBrowse.
If so, how can I initate that?

In Windows apps you can click on the top of a column and it changes its sequence in alphabetical order f.i.

I use TsBrowse with great pleasure in all my apps.

Thanks for a reply.

Jules
[/b]
User avatar
tnhoe
Posts: 83
Joined: Tue Nov 08, 2005 11:09 am
Location: Malaysia
Contact:

Post by tnhoe »

oBrw:aActions := { {||msgstop('col 1')}, {||msgstop('col 2')}, {||msgstop('col 3')}, ... }
Regards

Hoe, email: easywin3@yahoo.com
Jules de Pierre
Posts: 21
Joined: Mon Mar 20, 2006 12:48 pm
Location: Netherlands

Clicking on a TsBrowse Column

Post by Jules de Pierre »

TNHOE,

Thanks for respnding,
Can you give more detailed info?
Where should I place the command: oBrW:aActions
How could the Array look like ,example

Should the function: msgstop('col 1') define the order of records ?

Thanks again.

Jules
User avatar
tnhoe
Posts: 83
Joined: Tue Nov 08, 2005 11:09 am
Location: Malaysia
Contact:

Post by tnhoe »

select('invoice') // fields: invoice,date,custcode

REDEFINE BROWSE oBrw ALIAS "invoice" ID 101 OF oDlg

oBrw:LoadFields( .T. ) // load all fields from dbf

oBrw:aActions:={ {|| fCol('1') },{|| fCol('2') },{|| fCol('3') } }

:
:

return .t.


// Your user defined function below,

function fCol(cX)

msginfo('Header Column clicked : '+cX)

select('invoice')
do case
case cX='1'
set order to tag invoice
case cX='2'
set order to tag date
case cX='3'
set order to tag custcode
endcase
oBrw:refresh()

return .t.
Regards

Hoe, email: easywin3@yahoo.com
Post Reply