2013-07-22 34 views
2

我嘗試使用checkboxmodel和http://jsfiddle.net/Veb7Q/中的校驗列。但是我發現了一個錯誤。
這是當我點擊checkboxmodel後,我點擊checkcolumn我看到沒有行被選中,但是當我點擊我的按鈕來選擇,它有?Extjs 4.1 - 網格中checkcolumn中的CheckboxModel失敗?

這裏是我的按鈕來獲得選擇

Ext.create('Ext.Button', { 
     text: 'Click me', 
     visible: false, 
     renderTo: Ext.getBody(), 
     handler: function() { 
      //alert('You clicked the button!'); 
      var s = grid.getSelectionModel().getSelection(); 
      Ext.each(s, function (item) { 
       alert(item.data.name); 
      }); 
     } 
    }); 


按照我的步驟中,您會看到一個錯誤
第1步:點擊checkboxmodel,你會看到如下

enter image description here

第2步:點擊活動列,你會看到如下圖 enter image description here

第3步:點擊按鈕「點擊我」,你會看到一個像這樣的錯誤? )。如何解決這個錯誤。由於

enter image description here

+0

問題出在「checkcolumn」與網格綁定....試圖解決它。 – Hariharan

回答

1

發現它..

只需添加 「stopSelection:假」 在你checkcolumn的xtype @trungkien

, { 
      xtype: 'checkcolumn', 
      text: 'Active', 
      dataIndex: 'active', 
      stopSelection : false, 
      align: 'center', 
      defaultType: 'boolean' 
     } 

我希望這會工作。

+0

謝謝你的工作:) – DeLe

相關問題