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

If you are looking for a responsive gridster, you can try this #604

Open
johe-a opened this issue Nov 26, 2018 · 0 comments
Open

If you are looking for a responsive gridster, you can try this #604

johe-a opened this issue Nov 26, 2018 · 0 comments

Comments

@johe-a
Copy link

johe-a commented Nov 26, 2018

My English is poor, this is my first time to open an issue.
If you want a responsive gridster, you can try this :

function girdsterResize ( ){
        //use the resize_widget_dimensions method, the variable baseDiemensionWidth is measured by yourself according to the container of gridster
        gridsterObj.resize_widget_dimensions({
            widget_base_dimensions: [baseDiemensionWidth, 100]
        });
    };

I found this answer from the Issues, but I also found it not work when I change to another router( i am using Angular to do a SPA)
After I debug my programmer , i found the solution to resolve this question.
At the source code of jquery.gridster.js, the method add_style_tag has an if statement

if (!document.getElementById(cssID)) 

Gridster.js create the <style> and insert into the ,if you change to another router , the statement always be false.
By remove the element which has ID called cssID before the statement, I realize a responsive gridster:

$('#'+cssID).remove();
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

1 participant