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

How to have scroll in the gridster while keeping the grid size #901

Open
lmarquinez opened this issue Jan 11, 2024 · 0 comments
Open

How to have scroll in the gridster while keeping the grid size #901

lmarquinez opened this issue Jan 11, 2024 · 0 comments

Comments

@lmarquinez
Copy link

lmarquinez commented Jan 11, 2024

When I have several gridster items a scroll appears, that is to say when I go beyond the 12 stable rows and by positioning more items and there is more scroll up to 24 rows each square is resized, that is to say each gridster item is resized. What I want is that the size of each square remains always the same, no matter how many rows it has and how much scroll there is, I don't want it to be out of shape.

 <div fxFlex.gt-sm="100" fxFlex.gt-xs="100" fxFlex="100">
      <gridster [options]="options">
          <gridster-item> </gridster-item>
      </gridster>
  </div>

These are the options that I pass to create the gridster:

 this.options = {
     gridSizeChangedCallback: this._gridSizeChanged,
     gridType: GridType.ScrollVertical,
     compactType: CompactType.None,
     margin: 20,
     outerMargin: false,
     outerMarginTop: null,
     outerMarginRight: null,
     outerMarginBottom: null,
     outerMarginLeft: null,
     mobileBreakpoint: 640,
     minCols: 24,
     maxCols: 24,
     minRows: 12,
     maxRows: 24,
     maxItemCols: 100,
     minItemCols: 2,
     maxItemRows: 100,
     minItemRows: 2,
     maxItemArea: 2500,
     minItemArea: 1,
     defaultItemCols: 2,
     defaultItemRows: 2,
     fixedColWidth: 90,
     fixedRowHeight: 90,
     keepFixedHeightInMobile: true,
     keepFixedWidthInMobile: false,
     scrollSensitivity: 10,
     scrollSpeed: 20,
     enableEmptyCellClick: false,
     enableEmptyCellContextMenu: false,
     enableEmptyCellDrop: false,
     enableEmptyCellDrag: false,
     emptyCellDragMaxCols: 50,
     emptyCellDragMaxRows: 50,
     ignoreMarginInRow: false,
     draggable: {
       enabled: false,
     },
     resizable: {
       enabled: false,
     },
     swap: false,
     pushItems: true,
     disablePushOnDrag: false,
     disablePushOnResize: false,
     pushDirections: { north: true, east: true, south: true, west: true },
     pushResizeItems: false,
     displayGrid: DisplayGrid.None,
     disableWindowResize: false,
     disableWarnings: false,
     scrollToNewItems: false
   };

I want to keep always the size with cols as 24 and rows from 12 to 24, here is the problem. I start with 12 rows and when I create more gridster elements below these 12 rows the scroll appears but the size of the gridster changes, and also the size of the gridster element changes, as well as each square box.

I have tried changing the gridType with fit and fixed and it keeps resizing every time a new line is added.

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