Ember components to build drag-and-drop multi-column grids powered by gridstack.js
- Ember.js v4.4 or above
- Ember CLI v4.4 or above
- Node.js v14 or above
ember install ember-gridstack
View the full v5.0.0 release notes for updates and breaking changes.
Used to construct a grid-stack layout
<GridStack> can take an options object attribute to configure the grid. All gridstack grid options are valid and take the form gs-{option}. However, when using <GridStack> the gs-{option} is omitted.
Example:
The full list of options can be found here: https://github.com/gridstack/gridstack.js/tree/v4.2.7/doc#grid-options
All gridstack events can be handled as Ember actions. They take the form on{Eventname}.
Example:
The full list of events can found here: https://github.com/gridstack/gridstack.js/tree/v4.2.7/doc#events
The <GridStack> component uses the block form to yield <GridStackItem> components. In addition, <GridStack> yields a reference to itself in the case inner components need the reference or would like to listen to events triggered on the grid element.
Example:
Used to construct a grid item inside a <GridStack> component
<GridStackItem> can take an options object attribute to configure the grid item. All gridstack item options are valid and take the form gs-{option}. However, when using <GridStackItem> the gs is omitted.
Example:
The full list of options can be found here: https://github.com/gridstack/gridstack.js/tree/v4.2.7/doc#item-options
The <GridStackItem> component uses the block form to yield the content of the item. In addition, <GridStackItem> yields a reference to itself in the case inner components need the reference or would like to listen to events triggered on the grid.
Example:
//custom-component.js
export default class CustomComponent extends Component {
didInsertElement() {
super.didInsertElement(...arguments);
this.parentContainer.element.addEventListener("resizestop", () => {
//handle resize
});
}
}For touch support do the following
By default, the bower dependencies for Gridstack will be installed automatically.