如何访问角度js中的隐藏列

时间:2015-05-18 10:41:41

标签: angularjs

我的数据网格中有一个名为id的列。我为该字段设置了visible:false,因为我不想在网格中显示该字段。

但是我怎样才能获得id中的值?有希望吗? 我正在添加列

columns.push({'sTitle':'id','visible': 'false'},{'sTitle':'name','visible': 'false'});

我正在检索选定行中的值

this.$view.on("click",function(event){
    selectedRow = event.target.parentElement;
    var name = selectedRow.cells[0].innerHTML;
}

在点击事件中,我无法获取id的值,因为没有为visible:false字段生成html。所以我正在寻找一种方法来访问我的id字段。

1 个答案:

答案 0 :(得分:0)

您应该使用display:none属性
- 编辑:
要为角度数据网格指定自定义css,还应指定列。类似的东西:

 $("#gridContainer").dxDataGrid({
    // ...
    columns: ['CompanyName', 'ContactName', 'City', 'Country']
});

Here's the page I referenced to
EDIT2:

由于您尝试检索字段的值,我建议您查看this answer