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
{{ message }}
Repository navigation
different order when reloading in oneColumnMode and normal mode #1816
If you add widgets with the addWidget function of gridStack while in normal column mode and then resize the window so it moves to oneColumnMode the widgets are displayed in the correct order but if you do a reload whilst in oneColumnMode the widgets will reload in a different order and when resizing it back to normal column mode display other than reloading it in normal mode.
there is no real way for me to know when adding 1 widget at a time into 1 column that you mean this was 12 column (or any other) layout - just because the x,y or w,h are bigger than [0,1] ? is that enough of a hint... maybe, since 1 column mode is so 'transient'. humm...
In my particular use-case, I've created a dashboard in 12-column layout and then used the Save Grid function. The serialised representation of the dashboard has the items in the correct row/column ordering. On resizing the page the oneColumnMode is consistent with the ordering in the serialised representation.
If the page is refreshed while sized for full 12-column layout mode, then the serialised items are loaded and the dashboard initialised correctly with oneColumnMode still showing the correct ordering if you then shrink the page.
However, if you size the page small enough for a oneColumnMode dashboard, then refresh the page to reload the dashboard items with oneColumnMode active ... the same set of serialised items are loaded, but the ordering isn't consistent with the ordering in the serialised items array. At least not in my case. It looks like it's using some logic other than using the defined array element index ordering, nor scanning for row/column in the gsY/gsX values.? That means that when sizing the page back up to 12-column mode the elements appear all over the place, despite them having been added with their correct position and width / height parameters (almost as if the x/y positions are discarded).
Haven't had time to dig into the code yet to confirm, so I could be wildly wrong here.
Activity
adumesny commentedon Sep 13, 2021
there is no real way for me to know when adding 1 widget at a time into 1 column that you mean this was 12 column (or any other) layout - just because the x,y or w,h are bigger than [0,1] ? is that enough of a hint... maybe, since 1 column mode is so 'transient'. humm...
scotcomms-saunderss commentedon Sep 13, 2021
In my particular use-case, I've created a dashboard in 12-column layout and then used the Save Grid function. The serialised representation of the dashboard has the items in the correct row/column ordering. On resizing the page the oneColumnMode is consistent with the ordering in the serialised representation.
If the page is refreshed while sized for full 12-column layout mode, then the serialised items are loaded and the dashboard initialised correctly with oneColumnMode still showing the correct ordering if you then shrink the page.
However, if you size the page small enough for a oneColumnMode dashboard, then refresh the page to reload the dashboard items with oneColumnMode active ... the same set of serialised items are loaded, but the ordering isn't consistent with the ordering in the serialised items array. At least not in my case. It looks like it's using some logic other than using the defined array element index ordering, nor scanning for row/column in the gsY/gsX values.? That means that when sizing the page back up to 12-column mode the elements appear all over the place, despite them having been added with their correct position and width / height parameters (almost as if the x/y positions are discarded).
Haven't had time to dig into the code yet to confirm, so I could be wildly wrong here.
adumesny commentedon Sep 13, 2021
same issue as #1849
save full res in 1 column mode
save full res in 1 column mode
adumesny commentedon Oct 16, 2021
fixed in next release. don't forget to donate if you find this lib useful!