我正在使用w2ui grid(1.4)和angular 1.3.4尝试在一个视图中渲染网格。
但是首先加载网格成功加载。但是当我更改视图网格加载失败时抛出一些错误

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).


那么每次成功加载网格的正确方法是什么。
我无法更改布局名称和网格名称。

以下是plnkr的链接:
http://plnkr.co/edit/HzxZwJ22z2ywYmlchxFM?p=preview

最佳答案

您应该先销毁w2ui对象

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

或与他们重复使用
w2ui.layout.content('left',w2ui['grid'])

09-27 13:05