0

I am using angular gridster, and I want to be able to do stuff like remove an item or disable it temporarily.

How to remove a single widget from gridster.js by his dynamically created id HighStocks draggable element interfering with gridster dragging

However, when I try to use the line $('.gridster ul').gridster().data('gridster');, I gett an error TypeError: $(...).gridster is not a function

Community
  • 1
  • 1

1 Answers1

0

At first, you have to initialise gridster. For that, you can use the below code

$(".gridster ul").gridster({
       widget_margins: [10, 10],
       widget_base_dimensions: [140, 140]
 });

the base dimension is the width and height in pixels for a single tile

then you can call

var gridster = $("#demo-2 ul").gridster().data('gridster'); //object of gridster
NIMISHAN
  • 1,265
  • 4
  • 20
  • 29