问题描述
Angular UI-Grid 有一个名为 footerTemplate 的属性,它应该提供创建自定义页脚模板的可能性.我尝试在字符串中输入 html 内容(带有一些文本的 div),我还尝试在字符串中添加 .html 文件名,甚至是渲染 div 的 ID,但它们似乎都不起作用.我也不清楚是否需要为此启用 showGridFooter,所以我都尝试了,但是 footerTemplate 要么根本没有显示,要么如果我将 showGridFooter 设置为 true,它会显示默认页脚(总行数)在网格中).我在这里错过了什么?
Angular UI-Grid has a property called footerTemplate, which is supposed to offer the possibility to create a custom footer template.I tried entering html content (a div with some text) in a string, I've also tried adding a .html file name in the string and even the ID of a rendered div, but none of them seem to work.It also wasn't clear for me if I need to enable showGridFooter for this or not, so I tried both, but the footerTemplate is either not shown at all, or if I set showGridFooter to true, it shows the default footer (total lines in the grid).What am I missing here?
推荐答案
对于 angular-ui-grid 3.0.x,它使用以下示例选项:
For angular-ui-grid 3.0.x it's working with the following example options:
$scope.options = {
showGridFooter: true,
gridFooterTemplate: '<div>pink floyd</div>'
};
对于 2.x ng-grid 版本,Mokgra 的版本很好.
For the 2.x ng-grid versions, Mokgra's version is good.
这篇关于如何让角度 ui grid footerTemplate 工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!