gridstack

can't read property addWidget of undefined with JSON and gridstack

我们两清 提交于 2021-01-29 11:11:17
问题 Running into a problem with my attempt to build a gridstack dash I get "Uncaught TypeError: Cannot read property 'addWidget' of undefined" when trying to load the page.. (the code is based on the basic gridstack serialized demo https://github.com/gridstack/gridstack.js/blob/develop/demo/serialization.html) my changed script section is <script type="text/javascript"> $(function() { var options = {}; $('.grid-stack').gridstack(options); new function() { this.grid = $('.grid-stack').data(

Prerender vue.js 2.0 component (similar to this.$compile in vue 1)

故事扮演 提交于 2019-12-10 22:01:25
问题 I'm trying to make reusable components for gridstack . I cannot find a simple way to do something similar to this.$compile method from vue 1 . I've seen this example. Here is my vue script: export default { components: { 'horizontal-fab': HorizontalFab, 'd-widget': DWidget }, data () { return { } }, mounted () { var options = { cellHeight: 80, verticalMargin: 10, width: 3 } $('#grid-stack').gridstack(options) }, addWid () { var grid = $('#grid-stack').data('gridstack') grid.addWidget('<d

Dynamic add component using gridstack and angular2? Jquery $.parseHTML does not work

柔情痞子 提交于 2019-11-30 17:22:19
I have the following jsfiddle I want to be able to stick my custom component into a specific grid (e.g. "") Right now without Angular2, I just use: var el = $.parseHTML("<div><div class=\"grid-stack-item-content\" data-id=\""+id+"\"/><div/>"); this.grid.add_widget(el, 0, 0, 6, 5, true); The issue is, I have no idea how I could do something like: var el = $.parseAndCompileHTMLWithComponent("<div><div class=\"grid-stack-item-content\" data-id=\""+id+"\"/><fancy-button></fancy-button><div/>"); this.grid.add_widget(el, 0, 0, 6, 5, true); In angular1, I know there is a compile, but in angular2,

Wrap gridstack.js into Angular 2 component

青春壹個敷衍的年華 提交于 2019-11-30 06:58:04
问题 I have some Angular 1 experience, but we have a need to use gridstack.js in an Angular 2 project. We are familiar with the gridstack-angular project, but that project is in Angular 1. I think the biggest thing I am having trouble with is the Angular 2 concepts. Any help would be appreciated. 回答1: Tutorials Okay for begginers the Angular 2 Quickstart is the best. Then that continues and moves into the Tour of Heroes. Which is also a fantastic tutorial. Tool For the tutorials, and quite frankly

Dynamic add component using gridstack and angular2? Jquery $.parseHTML does not work

∥☆過路亽.° 提交于 2019-11-30 01:05:40
问题 I have the following jsfiddle I want to be able to stick my custom component into a specific grid (e.g. "") Right now without Angular2, I just use: var el = $.parseHTML("<div><div class=\"grid-stack-item-content\" data-id=\""+id+"\"/><div/>"); this.grid.add_widget(el, 0, 0, 6, 5, true); The issue is, I have no idea how I could do something like: var el = $.parseAndCompileHTMLWithComponent("<div><div class=\"grid-stack-item-content\" data-id=\""+id+"\"/><fancy-button></fancy-button><div/>");