获取slickgrid中所选行的数据 [英] get data of selected rows in slickgrid

查看:185
本文介绍了获取slickgrid中所选行的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个slickgrid,其中一些行被一个过滤器隐藏(DataView)。

I have a slickgrid in which some rows are hidden by a filter (DataView).

当我现在调用网格的getSelectedRows方法时,我获得了索引明显选择的行。但我需要所选行的实际数据。

When I now call the getSelectedRows method of the grid I get the indices of the visibly selected rows. But I need the actual data of the selected rows.

推荐答案

你必须这样做:

var selectedData = [],
    selectedIndexes;

selectedIndexes = _grid.getSelectedRows();
jQuery.each(selectedIndexes, function (index, value) {
  selectedData.push(_grid.getData()[value]);
});

现在 selectedData 变量包含所选行的数据。

Right now the selectedData variable contains data for selected rows.

这篇关于获取slickgrid中所选行的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆