Comments (3)
Hi,
by doing this:
myElement = $('#myWidgetDiv'+wc_id).outerHTML;
myElement = $(myElement); // with this line or without same error with the method remove_widget
you create a new unattached DOM node. It doesn't contain gridstack's data attribute that's why you see the error.
Instead of this you should find a node inside the grid and then remove it:
myElement = $('#myWidgetDiv'+wc_id);
var grid = $('.grid-stack').data('gridstack');
grid.remove_widget(myElement);
from gridstack.js.
Thx for the logical explanation Pavel :)
from gridstack.js.
So the standard way to remove widgets with gridstack would be to have ids on all our widgets. When we want to remove one, we find it using $("#widgetId") and then pass it to the remove_widget function ?
Any update would really be appreciated @troolee , thanks !
from gridstack.js.
Related Issues (20)
- IOS auto scrolling doesn't work HOT 2
- [BUG] Dragging a widget into the grid doesn't honour expected aspect ratio HOT 2
- Any way to flip the direction of the board? HOT 1
- [Bug] After load(), in some cases the Y position is determined incorrectly & sizes are not restored. HOT 14
- Gridstack in WordPress editor (Gutenberg) mobile preview iframe not working. HOT 5
- Change event not firing on nested grids (resize, move...) HOT 1
- Angular wrapper doesnt have fitToContent option HOT 2
- Demo for lit is not working (https://gridstackjs.com/demo/web-comp.html)
- Responsive grids don't render items with minW correctly on resize HOT 3
- Custom drag element of type button doesn't work HOT 1
- Responsive grid coordinates system is inconsistent HOT 5
- Scale & Different Resolution Question HOT 5
- Unable to set max grid height HOT 2
- How to use Angular library (like PrimeNg) components in gridstack HOT 1
- GridStack's draggable option doesn't behave as expected when using Vue Rendering Grid Item Content HOT 4
- Updating DOM stack elements within the captured change event are not reflected. HOT 5
- The Change event is not always fired when items have changed after dragging HOT 2
- MakeSubGrid example in the documentation does not work HOT 1
- 'R' can rotate fixed sized or width/height items HOT 4
- Can't cancel an external item from being dragged by pressing 'Esc' key HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gridstack.js.