PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WD20] Table - Save the column configuration
[WD20] Table - Save the column configuration
Iniciado por guest, 15,dic. 2015 15:56 - 4 respuestas
Publicado el 15,diciembre 2015 - 15:56
Hi,

for some reasons I can´t use the build-in function to save my table column configuration.
Is there an easy way to put this in an *.ini file ?
Miembro registrado
9 mensajes
Publicado el 15,diciembre 2015 - 18:00
Hi,
I think you might find a solution with the function InitParameter().
Publicado el 16,diciembre 2015 - 16:00
Hi Michael,

Perhaps you can use InitParameter, LoadParameter, SaveParameter.

Regards,
Piet
Publicado el 16,diciembre 2015 - 16:01
Hi Piet,

thats clear.

But I am searching for "TablesavemyConfiguration" and "Tablerestoremyconfiguration" or something similar.
Publicado el 16,diciembre 2015 - 16:24
Hi Michael, I never heard of such a request, but it's a valid idea! I think, it should be not too hard to develop both functions based on my ResetColumnConfiguration function. This function restores the original configuration, based on InitialWidth, InitialVisible and recalculates the width of each column based on the current width of the Table control (-18 pixels for the width of the vertical scrollbar). Note: this function works only, if the anchoring of all columns adds up to 100% !

PROCEDURE ResetColumnConfiguration() TC,TX, TW, TD are int PopName is string = PopupField() TN is string TC = TableCount(PopName,toColumn) FOR TX = 1 TO TC TN = TableEnumColumn(PopName,TX) TableMoveColumn(PopName,TN,TX) IF {PopName+"."+TN,indControl}..InitialVisible = False THEN {PopName+"."+TN,indControl}..Visible = False ELSE {PopName+"."+TN,indControl}..Visible = True END END FOR TX = 1 TO TC TN = TableEnumColumn(PopName,TX) {PopName+"."+TN,indControl}..Width = {PopName+"."+TN,indControl}..InitialWidth IF {PopName+"."+TN,indControl}..Visible = True THEN TW += {PopName+"."+TN,indControl}..Width END END TD = {PopName,indControl}..Width - TW - 18 // 18 ~= Width of vertical scrollbar of Table FOR TX = 1 TO TC TN = TableEnumColumn(PopName,TX) {PopName+"."+TN,indControl}..Width += TD * {PopName+"."+TN,indControl}..AnchorRateWidth / 1000 END RETURN