Angular version
Any chance to have an angular version?
I have it working (with ng2), at least at a basic level of functionality - will post code later.
I'll look into an Angular.js 2 version too.
@fergusg i have it working too, however issues arise when it comes to ngFor, i can make it work with predefined html but when using ngFor i can't make it work, do you have it working with dynamic data?
Ok i kind of found a hack to fix my issue, i just use $(window).trigger('resize'); to trigger the plugin's update after items are added as widget, it's a hacky fix, but at least it works.
Ok now it messes with the angular model detection.
@Luchillo when you do $(window).trigger('resize');, the asynchronous event occurs outside angular2 context(ngZone), at time angular2 doesn't run Change Detection. you need to run CD manually, you refer this answer by he has mentioned all possible way to run CD cycle.
Why does it occur outside angular 2? i just take data from an api and put it in the variable that i render with {{ widget.title }}: {{ widget.data[0].value }}, it just sinks when i started using the plugin?
Nope, tried the 3 ways and doesn't work, the plugin just won't play nicely with A2.
I have written a directive for Angular.IO generating a grid with specified options and resize event working. Hope to see this implemented in gridstack soon so I don't have to write everything myself.
@fergusg i have it working too, however issues arise when it comes to
ngFor, i can make it work with predefined html but when usingngFori can't make it work, do you have it working with dynamic data?
This is an older post, but in order to make gridstack work with *ngfor, the $('.grid-stack').gridstack(); command must be called in ngAfterViewInit
ngAfterViewInit() {
setTimeout(() => {
$('.grid-stack').gridstack();
this.gridStack = $('.grid-stack').data('gridstack');
}, 300); //This MUST finish after dynamic data is retrieved for ngfor, and calling these statements in another area just doesn't work
}
might be worth revisiting this thread as I've been using my own Angular (now 8)/Typescript based wrapper for gridstack for over 2.5 years now... I would think a lot more adoption if it came out of the box with angular support (might need separate npm image due to dependencies). But then again there are now native angular versions which look decent that didn't exist back when I adopted this...
Any updates on this?
no time I'm afraid... there are posted angular examples though...