Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
ember-gridstack
Advanced tools
Changelog
Readme
Ember components to build drag-and-drop multi-column grids powered by gridstack.js
ember install ember-gridstack
View the full v3.0.0 release notes for updates and breaking changes.
<GridStack @options={{hash animate=true}} @onChange={{this.change}}>
<GridStackItem @options={{hash x=0 y=0 w=6 h=2}}>
Widget #1
</GridStackItem>
<GridStackItem @options={{hash x=6 y=0 w=6 h=2}}>
Widget #2
</GridStackItem>
</GridStack>
<GridStack>
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:
<GridStack @options={{hash animate=true column=12 maxRow=10}}>
...
</GridStack>
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:
<GridStack
@onAdded={{this.added}}
@onChange={{this.change}}
@onDisable={{this.disabled}}
@onDragstart={{this.dragStart}}
@onDrag={{this.drag}}
@onDragstop={{this.dragStop}}
@onDropped={{this.dropped}}
@onEnable={{this.enabled}}
@onRemoved={{this.removed}}
@onResizestart={{this.resizeStart}}
@onResize={{this.resize}}
@onResizestop={{this.resizeStop}}
>
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:
<GridStack as |grid|>
<GridStackItem @options={{hash x=0 y=0 w=6 h=2}}>
Widget #1
</GridStackItem>
</GridStack>
<GridStackItem>
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:
<GridStackItem @options={{hash w=4 h=4 x=0 y=0 noMove=true}}>
...
</GridStackItem>
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:
<GridStackItem @options={{hash x=0 y=0 w=6 h=2}} as |item|>
<CustomComponent @parentContainer={{item}} />
</GridStackItem>
//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.
FAQs
Ember Gridstack
The npm package ember-gridstack receives a total of 2,628 weekly downloads. As such, ember-gridstack popularity was classified as popular.
We found that ember-gridstack demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.