Hi Isomorphic. I'm trying to implement a custom Ribbon that responds to window resizing (adding more rows for small screen/window sizes), since I'm not aware of such capability being supported currently. My ResizeHandler fires correctly and invokes my repondToWindowChanges() method, but when I try to setNumRows to 2 for my RibbonGroup elements, I can't seem to get them to redraw and display accordingly. Here is the code:
I tried calling redraw() and markForRedraw() on the custom Ribbon, after setting all groups numRows to 2. I also tried calling these two methods on the individual groups. Nothing seems to be taken by the control when it is redrawn. Can you please help me figuring our what am I missing here?
Do I need to destroy the ribbon and create it again for these rowNum changes to take effect?
I am working on Chrome Version 49.0.2623.87 m, SmartClient Version: v10.1p_2016-03-18/Pro Deployment (built 2016-03-18).
Thanks in advance for any help you can provide on this!
Code:
public void respondToWindowChanges() { double ribbonWidth = 0; for(RibbonGroup group: getRibbonGroupsByVisibility("visible")){ // the value is replaced intentionally to that the final value is the left coordinate // of the rightmost group, which is the last group that needs to fit on screen. ribbonWidth = group.getPageLeft(); } if(ribbonWidth > Page.getWidth()){ for(RibbonGroup group: getRibbonGroupsByVisibility("visible")){ group.setNumRows(2); } this.markForRedraw(); } }
Do I need to destroy the ribbon and create it again for these rowNum changes to take effect?
I am working on Chrome Version 49.0.2623.87 m, SmartClient Version: v10.1p_2016-03-18/Pro Deployment (built 2016-03-18).
Thanks in advance for any help you can provide on this!
Comment