Skip to content

Rows limit #2579

Closed
Closed

Description

@mattx264

Is it possible to put limit on rows? I would like to have set size of rows and you can not extend it.

Activity

  1. vmerz-mgy commented on Dec 15, 2023

    @vmerz-mgy

    gridstack.init({row: 5})
    or
    gridstack.init({minRow: 5, maxRow: 7})

    or read the docs ;)
    GridOptions

  2. john8329 commented on Jul 2, 2025

    @john8329

    I'd like to add a little caveat I found about this, it has to be done in the first initialization, if it's changed afterwards (in my case by changing the GridStackOptions in the Angular component, this specific property is ignored.

  3. adumesny commented on Jul 3, 2025

    @adumesny
    Member

    I'd like to add a little caveat I found about this, it has to be done in the first initialization, if it's changed afterwards (in my case by changing the GridStackOptions in the Angular component, this specific property is ignored.

    humm, that shoudl 'work' after as well. won't force a relayout (might not be possible if gril already too full) but also doesn't set the min CSS height, so missing some parts...

      /** initial options for creation of the grid */
      @Input() public set options(o: GridStackOptions) {
        if (this._grid) {
          this._grid.updateOptions(o);
        } else {
          this._options = o;
        }
      }
    
      public updateOptions(o: GridStackOptions): GridStack {
    ...
        if (o.row !== undefined) { opts.minRow = opts.maxRow = opts.row = o.row; }
        else {
          if (o.minRow !== undefined) opts.minRow = o.minRow;
          if (o.maxRow !== undefined) opts.maxRow = o.maxRow;
        }
    }
  4. john8329 commented on Jul 3, 2025

    @john8329

    My workaround is wrapping the grid in an @if block and initializing the component only after I assigned options asynchronously. Every other test brought the bug I mentioned, including re-calling oninit, assigning options using the gridstack method.

  5. adumesny commented on Jul 3, 2025

    @adumesny
    Member

    like I said the above code does set the properties but doesn't do anything right away about it which is a bug - file a bug if you want that fixed. donation would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions