Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrollbar appears at the bottom Grid #160

Open
vasu-vvp opened this issue Mar 20, 2018 · 1 comment
Open

scrollbar appears at the bottom Grid #160

vasu-vvp opened this issue Mar 20, 2018 · 1 comment

Comments

@vasu-vvp
Copy link

vasu-vvp commented Mar 20, 2018

I have scrollPan on which i have added Grid.
This scroll pan is added as 'center' component of root panel.
root.setBorderLayout() method is used to set layout. and then root.add('center', scrollPan) is called to add this scrollPan on root.
Refer image
image

To solve this I have tried following code :-

this.root.setLayout(new layout.BorderLayout([
                    function doLayout(target) {
                        this.$super(target);
                        for(var x = 0; x < target.kids.length; x++){
                            var kid = target.kids[x];
                            if(kid.constraints === 'center'){
                                var ps =  kid.getPreferredSize();
                                var targetWidth = target.width;
                                var targetHeight = target.height;
                                kid.setSize( ps.width > targetWidth ? targetWidth : ps.width,
                                    ps.height > targetHeight ? targetHeight : ps.height);
                                target.vrp();
                                //Calling break since intentionally since we will have only single grid
                                break;
                            }
                        }
                    }
                ]));

After this scrollbars appears as expected but when both scrollbars appears.
Refer image
image
which layout needs to be used for this. I tried various things for this.
Can you suggest how to resolve this issue ?

@vasu-vvp
Copy link
Author

vasu-vvp commented Mar 21, 2018

it seems that while calculating preferred size of scrollpan component thumb size is not considered.
This is resulting in a bug which is causing to appear the both the scrollbars on canvas even if there is enough space available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant