ducksboard / gridster.js

gridster.js is a jQuery plugin that makes building intuitive draggable layouts from elements spanning multiple columns
http://gridster.net/
MIT License
6.03k stars 1.2k forks source link

Resize Gridster Issue #303

Open okakade opened 10 years ago

okakade commented 10 years ago

How do I make my gridster resize as i am passing dynamic width and height to gridster. after passing my parameter i want to change the size by using UI. I am giving my code also here i am creating dynamic width and height.

var dash_CntHandlerWidth = $(window).width() - ($('.dash-pannel').width() + 70); var dash_CntHandlerHeight = $(window).height() - ($('.topBar').height() + $('.footer').height() + 110);

     min_default_placeHolder_width = parseInt(dash_CntHandlerWidth / 3);
     min_default_placeHolder_height = parseInt(dash_CntHandlerHeight / 3 + 80);

    var width = parseInt(min_default_placeHolder_width) * parseInt(1);
    var height = parseInt(min_default_placeHolder_height) * parseInt(1);
    if(Rows != 0)
    {
        width = parseInt(width) * parseInt(Column); 
    }   
    if(Column != 0)
    {
        height = parseInt(height) * parseInt(Rows); 
    }   

    ByDefaultPlaceHolder(width,height);
    gridster.add_widget("<li class='droppable7' id="+id+"><div id="+LoaderId+" class='l_loader'></div><div id="+headerFunctionalityId+" class='headerFunctionality' ></div><div class='chartPlace' id="+chartId+"></div><div id='chart_predionChart'></div><div id='datagrid' style='display:none;'></div><div id='Divpred' onclick='predict();' class='prd_box' style='display:none;'></div></li>", 1, 1);
    $('#'+ResizeId).resizable({ 
    grid: [min_default_placeHolder_width,min_default_placeHolder_height],
    animate: false,     
    containment: '#layouts_grid ul',
    autoHide: true,
    minWidth: width,
    autogenerate_stylesheet:true,
    avoid_overlapped_widgets:true,
    minHeight: height,
    stop: function(event, ui) {
        alert(1);
        var resized = $(this);
        setTimeout(function() {

            resizeBlock(resized);
        }, 300);
    } });