2015-11-01 49 views
2

我正在使用w2ui網格(1.4)和角度1.3.4試圖在一個視圖中呈現網格。 但在第一個電網負荷加載successfully.But當我改變了看法電網加載失敗拋出一些錯誤w2ui網格再現問題

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

回答

1

你shold破壞w2ui對象第一

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

或重用他們

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