在带有附加属性的Google图表中使用getFillteredRows [英] Using getFillteredRows in google charts with additional property
问题描述
我有这样的行结构
c:[
{v:'somevalue'},
{v:'somevalue'},
{
v:'somevalue',
link:'abc.com'
}
]
现在我需要链接属性存在于第3列的所有行,是否可以使用getFillteredRows函数?
首先,要正确使用 cell 属性,结构将类似于以下内容...
c:[
{v:'somevalue'},
{v:'somevalue'},
{
v:'somevalue',
p:{
link:'abc.com'
}
}
]
到 get 或 set 属性,请使用以下方法 ...
getProperty(rowIndex,columnIndex,na我)
setProperty(rowIndex,columnIndex,name,value)
在 getFilteredRows
(拼写 - 一个L在过滤器中)...
使用 test code>函数来查找第三列中存在link属性的所有行
var rowsFound = data.getFilteredRows([{
column:2,
test:function(value,row,column,table){
return(table.getProperty(row,column,'链接')!== null);
}
}]);
I have a row structure like this
c:[
{ v: 'somevalue'},
{ v: 'somevalue'},
{
v: 'somevalue',
link: 'abc.com'
}
]
now I need all the rows which has link property present in 3rd column, is it possible using getFillteredRows function ?
first, to use cell properties correctly, the structure would resemble the following...
c:[
{ v: 'somevalue'},
{ v: 'somevalue'},
{
v: 'somevalue',
p: {
link: 'abc.com'
}
}
]
to get or set the properties, use the following methods...
getProperty(rowIndex, columnIndex, name)
setProperty(rowIndex, columnIndex, name, value)
adding in getFilteredRows
(spelling - one L in filter)...
use the test
function, to find all the rows which has link property present in 3rd column
var rowsFound = data.getFilteredRows([{
column: 2,
test: function (value, row, column, table) {
return (table.getProperty(row, column, 'link') !== null);
}
}]);
这篇关于在带有附加属性的Google图表中使用getFillteredRows的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!