开发者

is there a way to add a summary row to jqgrid treeview

开发者 https://www.devze.com 2023-03-28 00:21 出处:网络
i am using jqgrid with the treegrid view and most of the columns are numbers that are aggregated up the tree.The one missing piece is having a total r开发者_运维技巧ow to aggregate the top level hiera

i am using jqgrid with the treegrid view and most of the columns are numbers that are aggregated up the tree. The one missing piece is having a total r开发者_运维技巧ow to aggregate the top level hierarchy. Is there something built into jqgrid to support this or should be passed down the:


Tree grid support footer row (see the second picture here) for tree grid in the same way like for the standard grid. If you calculate the content of the summary row on the server you can use userdata in the JSON input (see here). If you want have custom formatting of the summary row or if you want to calculate the values for the summary row on the client you can use footerData method inside of loadComplete for example. See here for an example.

The following simple demo produce the output:

is there a way to add a summary row to jqgrid treeview

The changes in the original treegrid code are the following:

footerrow: true,
loadComplete: function () {
    $(this).jqGrid('footerData','set',
        {name:'TOTAL', num:"500", debit:"<i>Bla</i> Bla",
        credit:'20', balance:'<span style="color:red">-1000</span>'});
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号