2

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

AKRICK
  • 55
  • 1
  • 7

1 Answers1

2

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'])
EdgarZ
  • 36
  • 2