Having Table View Reordered Columns Stick?

I’d like users to be able to both resize and reorder columns in a table view and have those changes stick!

Is this possible within Servoy or is it a case of rolling my own tool to do that on each form for each user?

How is the column resizeable property set on a table view?

Appreciate feedback.

Hi Kahuna,

Kahuna:
Is this possible within Servoy or is it a case of rolling my own tool to do that on each form for each user?

You should write your own code for that one… it isn’t to hard (although I didn’t do it yet).
Easiest way - to store and recall - is to have a global object which will hold all formnames with element positions attached to it.
This global object could be stored as serialized text in the user record…

mboegem:
Hi Kahuna,
You should write your own code for that one… it isn’t to hard (although I didn’t do it yet).
Easiest way - to store and recall - is to have a global object which will hold all formnames with element positions attached to it.
This global object could be stored as serialized text in the user record…

Thanks Marc - thats sounds rather fancy! Have to look into serialising data - outside of my expertise currently :? but sounds interesting. Is thre a simple what to determine the current table order?

Any feedback on resizing table columns?

Hi Kahuna,

Columns are resizable if you put an anchor on the left and right of the column

sanneke:
Hi Kahuna,

Columns are resizable if you put an anchor on the left and right of the column

8) Thanks Sanneke - nice one!

You can ask all this properties of a field, save them in a table in the unOnload trigger of the form:

forms.yourform.elements.yourlement.getLocationX();
forms.yourform.elements.yourlement.getLocationY();

forms.yourform.elements.yourlement.getWidth();
forms.yourform.elements.yourlement.getHeight();

and then in the onLoad trigger of the form you can set them back:

forms.yourform.elements.yourlement.setSize(_width, _height);
forms.yourform.elements.yourlement.setLocation(_x, _y);

I hope this helps.

sanneke:
You can ask all this properties of a field, save them in a table in the unOnload trigger of the form:

forms.yourform.elements.yourlement.getLocationX();
forms.yourform.elements.yourlement.getLocationY();

forms.yourform.elements.yourlement.getWidth();
forms.yourform.elements.yourlement.getHeight();

and then in the onLoad trigger of the form you can set them back:

forms.yourform.elements.yourlement.setSize(_width, _height);
forms.yourform.elements.yourlement.setLocation(_x, _y);

I hope this helps.

:D WOW Brilliant - thanks Sanneke - that makes it easy!

– my bad :oops:

Cheers,
Maria

Just curious: is there a way to disable some columns from being dragged in the grid?

And one more issue: how do I have reordered columns stick if I have no records in the foundset?
No records - no fields. The field widths are taken from design-time dimensions of elements in that case.

Thanks,
Maria