Open ionHive opened 8 years ago
I'm trying to dynamically add widgets to gridster using add_widget method. My code is as follows: gridster = $(".gridster ul").gridster({widget_selector: "li", widget_margins: [5, 5], widget_base_dimensions: [120, 40], min_cols: 0, min_rows: 0, max_size_x: false, avoid_overlapped_widgets: true}).data('gridster');
gridster = $(".gridster ul").gridster({widget_selector: "li", widget_margins: [5, 5], widget_base_dimensions: [120, 40], min_cols: 0, min_rows: 0, max_size_x: false, avoid_overlapped_widgets: true}).data('gridster');
gridster.add_widget('<li><div>'+docItem.description+'</div><div>'+docItem.vals+'</div></li>', 1, 1, docItem.col, docItem.row);
I get the following as HTML when i use (col, row) as (1,1) and (2,2) in add_widget:
`
What is happening here?
What I noticed if I have this structure:
you have to add widget this way:
gridster.add_widget('< div class="gridster ready" >', 1,1,1,1)
I'm trying to dynamically add widgets to gridster using add_widget method. My code is as follows:
gridster = $(".gridster ul").gridster({widget_selector: "li", widget_margins: [5, 5], widget_base_dimensions: [120, 40], min_cols: 0, min_rows: 0, max_size_x: false, avoid_overlapped_widgets: true}).data('gridster');
gridster.add_widget('<li><div>'+docItem.description+'</div><div>'+docItem.vals+'</div></li>', 1, 1, docItem.col, docItem.row);
I get the following as HTML when i use (col, row) as (1,1) and (2,2) in add_widget:
`
What is happening here?