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
Post a Comment