xTuple.com xTupleU Blog & News Customer Support

Xtreewidget Sorting

Using windows 5.0.1 and 6.0.3

I have a script that takes the core contract screen and add custom columns in the core xTreeWidget.

The issue that I am having is that the custom columns do not sort properly.
Strings seems to sort Ok, but numbers and boolean do not.

I do not see a signal in the xTreeWidget code to tell me this column is to be sorted.

So is there a workaround for this issue.

I also noticed it in 6.0.3 which we are testing.

How is the data put into the custom column.
in the meta-sql are you using

SELECT
formatQty(qty_field) AS qty_field

If so this will change it into a string. in which case

it would be sorted like

1
100
2
3
4918495
9

I believe if you use the xTuple
correct way is something along the lines of

SELECT
qty_field,
'qty' AS qty_field_xtnumericrole

Someone from xTuple may be able to correct the column name on the second.
I do know that it would by qtforegroundrole if you wanted to change the color. but I cant remember the format

EDIT: corrected xtformatrole to xtnumericrole

Thanks caleb, I will give that a try