You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks, @ZoolWay . I have lots of excuses for why version 1 wasn't released yet, but I'll save myself some face and just say: shoot. I missed a deadline badly. I'm working on a plan to increase transparency so that it's more obvious to see the status of all gridstack features. Look for a blog post soon - I'll get into a regular cadence with that as well.
@radiolips Any update on this feature's eta?
I want to be able to have my grid items get pushed across the row as new widgets are added rather than be pushed down the page.
@sunlanterns new items are added in the first slot available (autoPosition or missing x,y) first, starting in the top/left corner (that part should be configurable to support rtl). that part wouldn't change.
but I guess you saying when manually moving a widget around, we push conflicting items down, while you want them pushed to the right (and therefore reflow below ?)
@adumesny Sorry for the late response. I think that sounds right.
In my use case we always add our newest widget at the 0,0 slot. This ends up pushing any pre-existing widget in that spot down, when I would rather it be pushed to the right.
@sunlanterns do you have to have new items added at the beginning (0,0) ? because otherwise adding them without explicit x,y would add them in a row as you requested. But I could see supporting a left/right flow as you move things around, instead of pushing down.
Also @ISNIT0 I don't think 'bottom' gravity makes sense (browser scroll for content) as how far would you put them ? what scenario are you trying to solve ? Tetris game ? :)
@adumesny Yes, we have to have them added at the beginning. Just to explain, we have users choosing to add widgets dynamically themselves - and users expect that new widget to show up close to the add widget button, and not possibly out of sight down the page in the next available slot.
you might be able to do that yourself for now using similar code to what I recently did in compact() method - make gridstack believe it has no items, add the new one in, then loop over the old ones adding them to their old position (if no conflict, else use autoPosition to find next space).
@adumesny At that point I feel like I'm having to re-implement the positioning logic completely, which is something I don't want to do or I wouldn't have grabbed a grid framework to begin with and written it myself.
uuuuh, GristackEngine.compact() does it in 8 lines of code (with half handling edges cases you likely don't care) but whatever...
constcopyNodes=this.nodes;this.nodes=[];// pretend we have no nodes to conflict layout to start with...copyNodes.forEach((n,index,list)=>{letafter: GridStackNode;if(!n.locked){n.autoPosition=true;if(layout==='list'&&index)after=list[index-1];}this.addNode(n,false,after);// 'false' for add event trigger});
Hello @adumesny is there currently a way to restrict the motion items only to right when moving (resolve collisions only to the right and not down) as this
we already used your library in a large project, but users demand this behavior change
so Could you give us Idea how could we make it or where to override in the engine, we are willing to contribute
Otherwise we will have to reimplement everything manually and remove GridStack
@m7mdyahia you cannot do the manually collision easily. the above Q was to insert at 0,0 which is different as that is a one time thing...
there has been request to support a 'list' mode (vs float true:false) which could be added for the right donation.
Activity
ZoolWay commentedon Aug 31, 2017
If you take a look at the blog post, https://dylandreams.com/2017/04/26/gridstack-10-coming-soon/ , that's a 1.0 feature. It highly awaited ;)
radiolips commentedon Sep 5, 2017
Thanks, @ZoolWay . I have lots of excuses for why version 1 wasn't released yet, but I'll save myself some face and just say: shoot. I missed a deadline badly. I'm working on a plan to increase transparency so that it's more obvious to see the status of all gridstack features. Look for a blog post soon - I'll get into a regular cadence with that as well.
radiolips commentedon Sep 5, 2017
(but, yes, it's one of the features in the [uuuugh as-yet-unreleased] version 1.0.
fictivecreations commentedon Sep 13, 2019
@radiolips Any update on this feature's eta?
I want to be able to have my grid items get pushed across the row as new widgets are added rather than be pushed down the page.
adumesny commentedon Dec 21, 2019
@sunlanterns new items are added in the first slot available (
autoPositionor missing x,y) first, starting in the top/left corner (that part should be configurable to support rtl). that part wouldn't change.but I guess you saying when manually moving a widget around, we push conflicting items down, while you want them pushed to the right (and therefore reflow below ?)
fictivecreations commentedon Jan 6, 2020
@adumesny Sorry for the late response. I think that sounds right.
In my use case we always add our newest widget at the 0,0 slot. This ends up pushing any pre-existing widget in that spot down, when I would rather it be pushed to the right.
adumesny commentedon Jan 6, 2020
@sunlanterns do you have to have new items added at the beginning (0,0) ? because otherwise adding them without explicit x,y would add them in a row as you requested. But I could see supporting a left/right flow as you move things around, instead of pushing down.
Also @ISNIT0 I don't think 'bottom' gravity makes sense (browser scroll for content) as how far would you put them ? what scenario are you trying to solve ? Tetris game ? :)
fictivecreations commentedon Jan 6, 2020
@adumesny Yes, we have to have them added at the beginning. Just to explain, we have users choosing to add widgets dynamically themselves - and users expect that new widget to show up close to the add widget button, and not possibly out of sight down the page in the next available slot.
adumesny commentedon Jan 7, 2020
you might be able to do that yourself for now using similar code to what I recently did in
compact()method - make gridstack believe it has no items, add the new one in, then loop over the old ones adding them to their old position (if no conflict, else useautoPositionto find next space).would be nice to have contributions on this
fictivecreations commentedon Jan 10, 2020
@adumesny At that point I feel like I'm having to re-implement the positioning logic completely, which is something I don't want to do or I wouldn't have grabbed a grid framework to begin with and written it myself.
adumesny commentedon Jul 25, 2024
uuuuh,
GristackEngine.compact()does it in 8 lines of code (with half handling edges cases you likely don't care) but whatever...m7mdyahia commentedon Sep 18, 2024
Hello @adumesny is there currently a way to restrict the motion items only to right when moving (resolve collisions only to the right and not down) as this
we already used your library in a large project, but users demand this behavior change
so Could you give us Idea how could we make it or where to override in the engine, we are willing to contribute
Otherwise we will have to reimplement everything manually and remove GridStack
adumesny commentedon Sep 20, 2024
@m7mdyahia you cannot do the manually collision easily. the above Q was to insert at 0,0 which is different as that is a one time thing...
there has been request to support a 'list' mode (vs float true:false) which could be added for the right donation.
m7mdyahia commentedon Sep 20, 2024
You mean by his
#149 (comment)
adumesny commentedon Sep 21, 2024
no that's horizontal swap which already exists... I mean new mode = top | float | list | compact. would be a lot of work...
adumesny commentedon Sep 14, 2026
FIY, looking at implementing mode: 'top' | 'float' | 'list' | 'compact' option instead of just the old float:boolean option
new `mode?: 'top' | 'float' | 'list' | 'compact'`