Page 1 of 1

How to get ID of dcbrowsecol?

Posted: Fri Mar 10, 2017 5:57 am
by skiman
Hi,

I want to determine in which column someone clicked.

I did this with oBrowse:colpos. This works but when I add the ability to MOVE columns, this won't work anymore. I thought to use the ID clause to determine the ID of a column.

nCol := oBrowse:colpos
oCol:= obrowse:getColumn(nCol)

I expected to use oCol:ID, but this doesn't exist. I can add this to the class, but maybe there is an easier way?

Re: How to get ID of dcbrowsecol?

Posted: Fri Mar 10, 2017 9:04 am
by reganc
Couldn't you just add the column ID in the cargo slot and then query that?

Re: How to get ID of dcbrowsecol?

Posted: Fri Mar 10, 2017 9:43 am
by rdonnay
Try this:

Code: Select all

nCol := oBrowse:colpos
oCol:= obrowse:getColumn(nCol)
cID := GetList[AScan(GetList,{|a|a[oGETLIST_OBJECT==oCol}),cGETLIST_ID]

Re: How to get ID of dcbrowsecol?

Posted: Mon Mar 13, 2017 1:14 am
by skiman
Hi,

Code: Select all

cID := GetList[AScan(GetList,{|a|a[oGETLIST_OBJECT]==oCol}),cGETLIST_ID]
Works perfect.