javascript - Gridstack undefined when calling $(".grid-stack").data("gridstack") in global context -


gridstack javascript library can found here. don't know whether need define grid within original function created, can't seem call gridstack , defined. how call gridstack in context want below? thank in advance.

$("#button").click(function(){   //var el ='<div class="grid-stack-item-content" />test<div/>';  var grid = $(".grid-stack").data("gridstack");  alert(grid); //this undefined   });    $(function () {    var options = {        cell_height: 80,        vertical_margin: 10    };     $('.grid-stack').gridstack(options);    }); 


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - How to Hide Date Menu from Datepicker in yii2 -