[4.0.4] Hidden Button re appearing on resize of the page

Posted by Meryk on 04-Jan-2016 06:25

Hello,

I have a workflow button that I am hiding on load of a view page this way :

   $('a:contains("myText")').css('display', 'none');

When I resize the page the button re appears again. We can work around this by hiding the button on resize of the page in addition to the onload, but we were wondering why is it behaving like that ?

Should we hide the button in a different way maybe?

Thanks,

Meryem

Posted by Thierry Ciot on 20-Jan-2016 20:03

Yes, it should work.

You can try a few things:  

1) Add the event handler in a custom header or side bar and see if it gets triggered

2) Could you try this pattern instead: $(document).on ( rb.newui.util.customEvents.rbs_uiResized, function( customEvent ) {

....

});

All Replies

Posted by Thierry Ciot on 04-Jan-2016 15:34
You can use: rb.newui.util.addEventListener ( rb.newui.util.customEvents. rbs_uiResized,  function(){ alert(' resized ….. '); });
 
 
Posted by Meryk on 05-Jan-2016 03:11

Hi Thierry,

I guess this is how we catch the resizing event of the page. is that right ?

I was more asking about how to make the button hidden all the time without having to handle the case of page resizing separately, if this is possible ..

And also why is the button re appearing on resize ?

Thanks

Meryem

Posted by Aede Hoekstra on 05-Jan-2016 06:51

Hi Meryem,

Why do you want to hide a workflow button client side? My approach would be to set a condition on the workflow action to show or hide the button/action on the page.

Posted by IramK on 20-Jan-2016 04:22

Hello [mention:c6ad25f95bb84e839bc6845bc8789e44:e9ed411860ed4f2ba0265705b8793d05],

I tried to use the event handler function you described above to hide the "Save and New" button on an Edit page on resizing, however it doesn't really seem to work. I am on version 4.0.4. Is this supposed to work in this version?

Cheers.

Iram

Posted by Thierry Ciot on 20-Jan-2016 20:03

Yes, it should work.

You can try a few things:  

1) Add the event handler in a custom header or side bar and see if it gets triggered

2) Could you try this pattern instead: $(document).on ( rb.newui.util.customEvents.rbs_uiResized, function( customEvent ) {

....

});

Posted by IramK on 21-Jan-2016 03:17

Yes, that's fine. $(document).on... does work. Thanks for the solution. Is there going to be a more easier way to control this in the future as I would not want to have Save and New on a lot of pages and its time consuming to keep the code everywhere. Kindly let me know.

Just wondering if you have any particular date for this: community.progress.com/.../the_ability_to_control_the_rollbase_save_savenew_button_on_rollbase_pages

Cheers.

Iram

Posted by murali on 21-Jan-2016 03:28
Iram,
                Its slotted for Q2. Release dates may vary.
Posted by IramK on 21-Jan-2016 03:32
Thanks Murali for confirming.
 
Cheers,
Iram
 
Posted by IramK on 21-Jan-2016 03:33

Thanks murali for confirming.

Cheers.

Iram

This thread is closed