|
10 | 10 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
11 | 11 | <title>Knockout.js demo</title> |
12 | 12 |
|
13 | | - <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"> |
| 13 | + <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.css"> |
14 | 14 | <link rel="stylesheet" href="../dist/gridstack.css"/> |
15 | 15 |
|
16 | | - <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> |
| 16 | + <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.js"></script> |
17 | 17 | <script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.js"></script> |
18 | | - <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script> |
19 | | - <script src="https://cdnjs.cloudflare.com/ajax/libs/core-js/2.6.9/shim.min.js"></script> |
20 | | - <script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.5.0/knockout-min.js"></script> |
| 18 | + <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.js"></script> |
| 19 | + <script src="https://cdnjs.cloudflare.com/ajax/libs/core-js/2.6.9/shim.js"></script> |
| 20 | + <script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.5.0/knockout-debug.js"></script> |
21 | 21 | <script src="../src/gridstack.js"></script> |
22 | 22 | <script src="../src/gridstack.jQueryUI.js"></script> |
23 | 23 |
|
@@ -77,8 +77,8 @@ <h1>knockout.js Demo</h1> |
77 | 77 | template: |
78 | 78 | [ |
79 | 79 | '<div class="grid-stack" data-bind="foreach: {data: widgets, afterRender: afterAddWidget}">', |
80 | | - ' <div class="grid-stack-item" data-bind="attr: {\'data-gs-x\': $data.x, \'data-gs-y\': $data.y, \'data-gs-width\': $data.width, \'data-gs-height\': $data.height, \'data-gs-auto-position\': $data.auto_position}">', |
81 | | - ' <div class="grid-stack-item-content"><button data-bind="click: $root.deleteWidget">Delete me</button></div>', |
| 80 | + ' <div class="grid-stack-item" data-bind="attr: {\'data-gs-x\': $data.x, \'data-gs-y\': $data.y, \'data-gs-width\': $data.width, \'data-gs-height\': $data.height, \'data-gs-auto-position\': $data.auto_position, \'data-gs-id\': $data.id}">', |
| 81 | + ' <div class="grid-stack-item-content"><button data-bind="click: $root.deleteWidget">Delete me</button></div>', |
82 | 82 | ' </div>', |
83 | 83 | '</div> ' |
84 | 84 | ].join('') |
@@ -108,10 +108,10 @@ <h1>knockout.js Demo</h1> |
108 | 108 | }; |
109 | 109 |
|
110 | 110 | var widgets = [ |
111 | | - {x: 0, y: 0, width: 2, height: 2}, |
112 | | - {x: 2, y: 0, width: 4, height: 2}, |
113 | | - {x: 6, y: 0, width: 2, height: 4}, |
114 | | - {x: 1, y: 2, width: 4, height: 2} |
| 111 | + {x: 0, y: 0, width: 2, height: 2, id: '0'}, |
| 112 | + {x: 2, y: 0, width: 4, height: 2, id: '1'}, |
| 113 | + {x: 6, y: 0, width: 2, height: 4, id: '2'}, |
| 114 | + {x: 1, y: 2, width: 4, height: 2, id: '3'} |
115 | 115 | ]; |
116 | 116 |
|
117 | 117 | var controller = new Controller(widgets); |
|
0 commit comments