jQuery GridManager when refresh page button control multiply

Discussão em 'Angular' iniciado por khalil _diouri, Abril 8, 2025.

  1. 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 Editable Region multiply every1]1 time I navigate and come back to grid page I found that the button Add Editable Region multiplied

    [​IMG]

    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'});
    }
    };


    this Method in gridmanager.js that add buttons which multiply

    Continue reading...

Compartilhe esta Página