Skip to content
This repository has been archived by the owner on Dec 31, 2020. It is now read-only.

Resize component in GridStack without moving component down #15

Closed
Artgit opened this issue Jul 16, 2016 · 4 comments
Closed

Resize component in GridStack without moving component down #15

Artgit opened this issue Jul 16, 2016 · 4 comments

Comments

@Artgit
Copy link

Artgit commented Jul 16, 2016

I need to programmatically resize a certain component in GridStack (new GridStackLayout(1).setCellHeight(140).setAnimate(true);).

I'm using a following method for this purpose:

gridStack.resizeComponent(component, null, 2);

right after that the resized component is moving to the bottom of GridStack container. How to prevent the component from moving down and leave it at its position ?

@alump
Copy link
Owner

alump commented Jul 17, 2016

Are you sure it doesn't overlap with existing component in layout? gridstack on client side will find the closest free position. So might be good idea to iterate all components in layout and move those to new locations.

@Artgit
Copy link
Author

Artgit commented Jul 17, 2016

thanks for your answer. Just for clarification, for example I have a following omponents:

1
2
3
4
5
6
7

I have to resize component 2 in order to be 2 times bigger(components 3 and the rest should be moved down), something like this

1
2
2
3
4
5
6
7

What should I do in order to achieve it ? This is one column layout

@alump
Copy link
Owner

alump commented Jul 17, 2016

call gridStackComponent.moveComponent(thirdComponent, 0, 3) ... moveComponent(fourthComponent, 0, 4) ... etc... just to make sure those make empty space to slot 0,2

@Artgit
Copy link
Author

Artgit commented Jul 17, 2016

Awesome. Thank you very much !

Could you please also help me with a following question #16 ?

@alump alump closed this as completed Jul 20, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants