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

Jquery GridManager when refresh page button control multiply gm.initDefaultButtons #87

Open
khalildiouriadservio opened this issue Jun 20, 2016 · 2 comments

Comments

@khalildiouriadservio
Copy link

I added a gridmanager (jquery) to my project angular2 using typescript in my ngAfterViewInit I added this

this.gm = jQuery("#content").gridmanager().data('gridmanager'); this.canvas = this.gm.$el.find("#" + this.gm.options.canvasId); this.gm.initGlobalCustomControls();
to init my grid,
so when I navigate to open again my div where I have the grid the button Add Edittable Region multiply every time I navigate and come back to grid page I found that the button Add Edditable Refion multiplied

`gm.initDefaultButtons = function () {

        if (gm.options.colSelectEnabled) {
            gm.options.customControls.global_col.push(
                {callback: gm.selectColClick, loc: 'top', iconClass: 'fa fa-square-o', title: 'Select Column'});
        }
        if (gm.options.editableRegionEnabled) {
            gm.options.customControls.global_col.push(
                {callback: gm.addEditableAreaClick, loc: 'top', iconClass: 'fa fa-edit', title: 'Add Editable Region'});
        }
    };`
@neokoenig
Copy link
Owner

I don't have much experience with Angular/Typescript, but you shouldn't need to call initGlobalCustomControls yourself;

var gm = jQuery("#mycanvas").gridmanager().data('gridmanager'); should initialize the grid and parse the content within the canvas;

@khalildiouriadservio
Copy link
Author

khalildiouriadservio commented Jun 20, 2016

even if I remove it ,I get always the same problem
I need just to know how to configure gm.initDefaultButtons to avoid the multiplication of buttons

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

2 participants