javascript - Grid column renderer tooltip using meta.tdAttr -
i have been trying add tooltip pops when hover on cell in ext.grid.panel.
however, parameter "meta" renderer function column not have tdattr property!
renderer : function(value, meta, record, row, col) { if (value == 1 && record.data.state === 'accepted') { meta.tdcls = 'green'; console.log('value',value); console.log('meta',meta); console.log('meta.tdattr',meta.tdattr); console.log('meta.style',meta.style); meta.tdattr = 'data-qtip="' + value + '"'; return record.data.id; } else if (value == 1 && record.data.state === 'initial version') { meta.tdcls = 'white'; return record.data.id; } else if (value == 1) { meta.tdcls = 'red'; return record.data.id; } else { return ''; } }
sample console output:
value 1 meta object {tdcls: "", style: ""} meta.tdattr undefined meta.style
i feel might missing setting on grid view or grid panel, property not available on meta parameter seems strange. documentation:
metadata : object collection of metadata current cell; can used or modified renderer. recognized properties are: tdcls, tdattr, , style.
i have no idea why setting not there begin with, added manually around problem:
meta['tdattr'] = 'data-qtip="' + value + '"';
and worked!
Comments
Post a Comment