2

我正在使用 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

4

1 回答 1

2

你先销毁 w2ui 对象

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

或重复使用它们

w2ui.layout.content('left',w2ui['grid'])
于 2015-12-23T13:14:27.587 回答