Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gridstack Uncaught TypeError: Cannot set property '_id' of undefined #589

Open
chakravarthyecanarys opened this issue Jan 31, 2017 · 1 comment

Comments

@chakravarthyecanarys
Copy link

Hello, I getting this error - gridstack.js:377 Uncaught TypeError: Cannot set property '_id' of undefined

my JSON is as follows

[
{
"x": 1,
"y": 0,
"id": "4",
"nid": 14,
"width": 5,
"height": 3
},
{
"x": 4,
"y": 6,
"id": "8",
"nid": 15,
"width": 8,
"height": 3
}
]

and code is as follows -

var grid = jQuery('.grid-stack').data('gridstack');

grid.addWidget(jQuery('

Delete
'), sobj.x , sobj.y, sobj.width, sobj.height,false);
jQuery(".grid-stack-item").attr("id",sobj.nid);

jQuery(document).on( "click", ".grid-stack-item", function() {
//jQuery(this).addClass("activ");
var gridster = jQuery('.grid-stack').data('gridstack');
console.log(gridster);
gridster.removeWidget( jQuery(this).parent());
});

I wan to remove widget when click on swclose or atleast on widgte . so Please help in this . Thank you .

@2Owy
Copy link

2Owy commented Oct 16, 2017

Lol :)) This is gridster not gridstack :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants