2013-10-17 59 views
0

的價值,我想現在要做的就是顯示所選終端到另一個網格。我可以用這個代碼來獲得所選擇的終端:ExtJS的4.2:如何設置我有終端網格網格

var sel = scope.getTerminalGrid().getSelectionModel().getSelection(); 
var user = scope.getProfinfo().getForm().getValues(); 

for(var i=0; i < sel.length; i++) 
{ 
var terminals = sel[i].data; 
} 

回答

0

你可以簡單地獲得數據(在你的情況下高於其在「SEL」變量),然後在第二個網格存儲區加載它。

類似的東西:

var sel = scope.getTerminalGrid().getSelectionModel().getSelection(); 
var selRecords = sel.getSelection(); 
var secondGrid = scope.getMySecondGrid(); 
var secondStore = secondGrid.getStore(); 

secondGrid.removeAll(); //Clear the data 
secondGrid.add(selRecords); 

當然,我分開都在一個很大的變數,你可以抽象一些。

0

你能做到多種方式,一種是用拖放網格組,另一個是抓住第二家店的電網,像這樣。

var secondGrid = scope.getMySecondGrid() 
    secondGrid.getStore() 

商店是網格的強大底層數據結構。然後你可以在那裏加載你想要的任何數據。