admin管理员组文章数量:1327849
I'm using a dgrid but find the documentation available from the website (/) a bit lacking: it teaches you the basics but seems to leave you to work out how to do anything more plex by guesswork.
Specifically, I want to modify how the data I've loaded into a memory store is rendered. For example, I'd actually like to bine two columns from the store into one column in the grid with some additional text. Obviously one way would be to create a second memory store, iterate the first store and build the exact contents the dgrid should show in the second store. However, that feels clunky and like having to have two sets of the same data, just differently formated.
I can see there are renderRow and renderCell methods. Can anyone give me examples of how to use these, or point me to some documentation?
Thanks, Simon
I'm using a dgrid but find the documentation available from the website (http://dojofoundation/packages/dgrid/) a bit lacking: it teaches you the basics but seems to leave you to work out how to do anything more plex by guesswork.
Specifically, I want to modify how the data I've loaded into a memory store is rendered. For example, I'd actually like to bine two columns from the store into one column in the grid with some additional text. Obviously one way would be to create a second memory store, iterate the first store and build the exact contents the dgrid should show in the second store. However, that feels clunky and like having to have two sets of the same data, just differently formated.
I can see there are renderRow and renderCell methods. Can anyone give me examples of how to use these, or point me to some documentation?
Thanks, Simon
Share Improve this question asked Aug 31, 2013 at 14:07 KateKate 1,5761 gold badge17 silver badges36 bronze badges1 Answer
Reset to default 8The renderCell function gives you the data object, so you can build the cell using any properties from the data.
var columns = [
{
label : ' ',
field : 'plexCell',
renderCell: function(object, value, node, options) {
domHtml.set(node, object[propA] + ' (' + object[propB] + ')');
}
},
...
];
本文标签: javascriptdojo dgrid custom render cell contentsStack Overflow
版权声明:本文标题:javascript - dojo dgrid custom render cell contents - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742212971a2434053.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论