如何在ag-grid中的一行内呈现HTML? [英] How to render the HTML inside a row in ag-grid?
本文介绍了如何在ag-grid中的一行内呈现HTML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有任何api或其他东西可以用来在一行内呈现HTML.我可以绑定简单的html,但是我的HTML是动态的,并且包含一些角度指令,因此,如何在ag-grid中呈现该HTML.
Is there any api or something using which I can render HTML inside a row. I'am able to bind simple html but my HTML is dynamic and contains some angular directives so, how can I render that HTML in ag-grid.
推荐答案
添加到包含HTML的特定列的columnDefs:
Add to the columnDefs of specific column which cells contain HTML:
cellRenderer: function(params) {
return params.value ? params.value : '';
}
这会愚蠢地使ag-grid认为您是通过自己的函数(从技术上来说就是)渲染列.
This fools ag-grid to think you are rendering column by your own function (which you technically are).
这篇关于如何在ag-grid中的一行内呈现HTML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文