【问题标题】:SlickGrid - get value of a cell in the first column of altered rowSlickGrid - 获取更改行第一列中单元格的值
【发布时间】:2015-09-21 01:28:37
【问题描述】:

我有一个 SlickGrid 表,其中第一列包含一个 ID 值。如果我更改表中的任何值,我想获取已编辑行上第一列的值。

我已经能够获得行索引,但我现在真的很纠结如何获得第一列的值。

 grid.onCellChange.subscribe(function(e, args) {
            //Identify the name of the column where a value was changed.
            var dataString = grid.getColumns()[args.cell].name
            alert(dataString);

            //Now identify the index of the row that was changed.
            var rowIndex = args.row;
            alert(rowIndex);

           //Return the value of the first column in this row.
           //Stuck...:(
           var firstColumnValue = ???
           alert(firstColumnValue);
        })

【问题讨论】:

    标签: javascript slickgrid


    【解决方案1】:

    解决了。

    var firstColumnValue = rows[args.row][grid.getColumns()[0].field];
    

    这正是我需要的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-11
      相关资源
      最近更新 更多