2016-10-27 5 views
1

extjsグリッドにチェックボックスモデルを添付しようとしています。私はBuffered Storeを使用していますが、それは起こっていません。私はselModel :checkBoxSelMod,を使用してグリッド設定でvar checkBoxSelMod = new Ext.grid.CheckboxSelectionModel();をデクリメントしますが、なぜそれが投げているのか分かりません。BufferedStoreグリッドに選択モデルを添付する方法

{ 
      xtype:'checkcolumn', 
      dataIndex:'selection', 
      listeners:{ 
       checkchange:function(checkbox , rowIndex , checked , record , eOpts){ 
        if(checked){ 
         var selections=grid.getSelection(); 
         selections.push(record); 
         grid.setSelection(selections); 
        }else{ 
         var selectionsDelete=grid.getSelection(); 
         Ext.Array.removeAt(selectionsDelete,selectionsDelete.indexOf(record)) 
         grid.setSelection(selectionsDelete); 
        }        
       } 
      } 
     } 

は、グリッド上の広告複数選択することを忘れないでください:ここで

selModel: {mode: 'MULTI'} 

はフィドルhttps://fiddle.sencha.com/#fiddle/1jd2

使用grid.getSelection(ある)レコードを取得するために、あなたはこれを使用することができますMy working Fiddler

+0

なぜあなたはselectionModelが必要ですか? –

+0

@ Mr.Georgeセルを選択したいのですが、 – David

+0

がわかりましたので、チェックボックスの列が必要ですか? –

答えて

1

選択された。

関連する問題