AKRICK
AKRICK

Reputation: 55

w2ui grid RE-rendering issue

I am using w2ui grid (1.4) and angular 1.3.4 trying to render grid in one view. But at first load grid loaded successfully.But when I change the view grid fails to load throwing some error

ERROR: The parameter "name" is not unique. There are other objects already created with the same name (obj: grid).
ERROR: The parameter "name" is not unique. There are other objects already created with the same name (obj: layout). 

so what is the correct way to load grid successfully everytime. I cannot change the layout name and grid name.

below is link for plnkr: http://plnkr.co/edit/HzxZwJ22z2ywYmlchxFM?p=preview

Upvotes: 2

Views: 2181

Answers (1)

EdgarZ
EdgarZ

Reputation: 36

you shold destroy the w2ui objects first

if(w2ui.hasOwnProperty('layout')){
  w2ui['layout'].destroy();
}
if(w2ui.hasOwnProperty('grid')){
  w2ui['grid'].destroy();
}

or reuse them with

w2ui.layout.content('left',w2ui['grid'])

Upvotes: 2

Related Questions