Grid widgets and defaulting columns to HID
Author: i.sharp@pcisystems.co.uk (Iain Sharp)
We can now use the $columnsyntax proc to hide a column at runtime (Yay! ). But if we want to define a column to either start hidden, or be hidden at all time (state etc fields) I think we still have to use the VISIBLE property of the grid widget. If we do this, the column layout state is not stored for that grid widget. Is there any easy way of defining a column at compilation time to be hidden which is not setting the VISIBLE parameter of the grid widget? Do I have to go through every program which uses grid widgets and alter the initialisation program to set $columnsyntax() for each of these fields to "HID" and then remove the VISIBLE parameter from the grid widget? If $columnsyntax(XXX)="HID" does uniface store the layout state on exit? Regards Iain
7 Comments
Local Administrator
Answering my own question. Using the $columnsyntax() to set the column to hidden causes it to stop storing the layout state on exit anyway. So we are still in the situation where if fields are hidden from the user, then the layout of the fields they CAN see is not stored. Oh dear. Iain
Author: Iain Sharp (i.sharp@pcisystems.co.uk)
Local Administrator
More news, I have some additional code which when put in the viewport_resized and column resized extended triggers, appears to have the desired effect (storing the column sizes even with hidden fields.) I'm going to try and paste them below, but with this forum not having a <CODE> block, it's a chancy prospect. Viewport_resized trigger
Column_resized trigger
Author: Iain Sharp (i.sharp@pcisystems.co.uk)
Local Administrator
Seems there IS a code block, you just have to hack about until it magically appears and then edit the post....
Author: Iain Sharp (i.sharp@pcisystems.co.uk)
Local Administrator
Thanks for sharing this. This is really a very useful tip!
Daniel
Author: diseli (daniel.iseli@uniface.com)
Local Administrator
I guess you also found the "fine print" in the documentation:
Sorry that I cannot provide any better news. Daniel
Author: diseli (daniel.iseli@uniface.com)
Local Administrator
I also detected that misfeature. What I am doing is the following: Just before closing the component I reset $columnsyntax, followed by a show-statement. For me it works fine. The layout is stored. Can be done generic without thinking of which columns are hidden or not. v_fldlst = $entinfo(v_entname, "PAINTEDFIELDS") forlist v_fld in v_fldlst $columnsyntax("%%v_feld%%%.%%v_entname") = "" endfor show Wolfgang
Author: gypsilon (wva@gypsilon.de)
Local Administrator
Does that work when you have defined the fields in the entity parameters of the IDF as entity parameter VISIBLE FIELD=F?
Author: Iain Sharp (i.sharp@pcisystems.co.uk)