This topic is locked
[SOLVED]

 Show/hide columns (PHPR 9.6)

8/3/2017 11:19:02 AM
PHPRunner General questions
T
taumic author

Hello,

Since the PHPR version 9.6 there is the feature "show/hide columns on the list pape in runtime".

This is a really good thing, but I have a question: if you have columns suppressed ("EVENTS/Before display on the list page")

for example:



If ($ _SESSION ['group'] <> "admin")

{

$ Xt-> assign ("k_telefonp_fieldheadercolumn", false);

$ Xt-> assign ("k_telefonp_fieldcolumn", false);

$ Xt-> assign ("k_telefong_fieldheadercolumn", false);

$ Xt-> assign ("k_telefong_fieldcolumn", false);

}



Then these suppressed column titles will still be displayed for select/deselect.

Is it wanted like that? Can you also suppress these desclected columns in the show/hide feature?

Otherwise the customers see the field names, which they should not actually see ...
I hope I could explain my problem. Or did I miss something?
Best regards
taumic

Sergey Kornilov admin 8/4/2017

This is the way how it works now. We will try to find a better way to make it work out of the box. For now you can add the following to List page Javascript OnLoad event:

$("#hide_k_telefonp").closest("li").remove();

$("#hide_k_telefong").closest("li").remove();
T
taumic author 8/7/2017

Many Thanks,

So I was able to help myself. But I am very interested in how this is further developed ....
Solution:

LIST PAGE - Before display - Event



$pageObject->setProxyValue("gruppe_JavaScript", $_SESSION['gruppe']);


LIST PAGE - JavaScript OnLoad - Event



if ( proxy['gruppe_JavaScript'] != "admin" )

{

$("#hide_k_telefonp").closest("li").remove();

$("#hide_k_telefong").closest("li").remove();

}


Maybe someone else helps it <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=82839&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />

Best regards
Taumic