Fun with DCBROWSE, FREEZELEFT and InsColumn()
Posted: Mon Mar 15, 2010 12:58 pm
I have a big DCBROWSE with 5 frozen columns on the left and 31-x (depending on the daycount of the month) non-frozen-columns on the right. Two of the five frozen columns on the left are optional; therefore, I create the browse WITH all five columns (the dialog is hidden) and delete those two optional columns using oBrowse:DelColumn. I show the dialog if this is finished (references to all columns are stored to an array). Before I created this system, I struggled around with creating browse columns on the fly, but this didn't work, since the DC_XbpColumn class has more iVars than standard XbpColumn (but I can't insert a DC_XbpColumn to a browse).
All the browse columns have unique identifiers in the CARGO slot, so I don't need to count how much optional columns are shown or not - in the datalink codeblock of DCBROWSE, I just look for the cargo[3] of the column (oBrowse:GetColumn(oBrowse:ColPos):cargo[3]) to identify the column.
So, now the user decides that he wants to see one of the optional columns or even both. I re-insert them at the right position (which works) using oBrowse:InsColumn(oStoredColumn). Everything fine? No.
Now, methods like oBrowse:GetColumn(oBrowse:ColPos):GetData() or :Cargo[3] return completely wrong results for the frozen columns. The display is still correct, but the column with former identifier "column1" now returns "column3" as :Cargo[3] and so on. If I look for the :GetData()-results, it's almost the same. As I said: The display is still correct, the browse dialog works besides this.
Is this a bug at :InsColumn() or am I doing something completely weird?
All the browse columns have unique identifiers in the CARGO slot, so I don't need to count how much optional columns are shown or not - in the datalink codeblock of DCBROWSE, I just look for the cargo[3] of the column (oBrowse:GetColumn(oBrowse:ColPos):cargo[3]) to identify the column.
So, now the user decides that he wants to see one of the optional columns or even both. I re-insert them at the right position (which works) using oBrowse:InsColumn(oStoredColumn). Everything fine? No.
Now, methods like oBrowse:GetColumn(oBrowse:ColPos):GetData() or :Cargo[3] return completely wrong results for the frozen columns. The display is still correct, but the column with former identifier "column1" now returns "column3" as :Cargo[3] and so on. If I look for the :GetData()-results, it's almost the same. As I said: The display is still correct, the browse dialog works besides this.
Is this a bug at :InsColumn() or am I doing something completely weird?