6

SlickGrid でセルの内容を取得するために使用する方法は何ですか? 例えば:

...
grid = new Slick.Grid($("#myGrid"), data, columns, options);
grid.onAddNewRow = function(item,colDef) {
  grid.removeRow(data.length);
  data.push(item);
  grid.updateRowCount();
  grid.render();
}

grid.onCurrentCellChanged = function(args){
  // get cell content!
};
...

前もって感謝します!

4

2 に答える 2

7

グリッドはデータ ソースを直接変更しているため、変更は「データ」に適用されます。「onCurrentCellChanged」イベントは、ユーザーがアクティブ/選択セルを変更したときに発生し、{row:currentRow, cell:currentCell} をパラメーターとして取得します。data[args.row][grid.getColumns()[args.cell].field]column.field を使用してデータにアクセスし、他の方法でデータを取得するカスタム フォーマッタではないと仮定すると、セル データにアクセスするには、 を使用できます。

于 2010-11-17T23:37:22.443 に答える
2

grid.onCurrentCellChangedgrid.onActiveCellChanged.subscribe2.0でに変更されたようです

于 2011-10-20T01:21:21.377 に答える