Jump to content

Grid summary on the paging bar


alesf76

Recommended Posts

2 hours ago, alesf76 said:

From here, thanks

One of the possible solutions I think, can you try?

function afterrender(sender, eOpts) 
{
    sender.getSummaryStrs = function(sender) {
        var
            me = sender,
            rStr = '',
            sFeature = me.getView().findFeature('summary');

        if (sFeature && sFeature.getSummaryBar()) {
            sFeature.getSummaryBar().ariaEl.select('.x-grid-cell-inner').elements.forEach(function(el) {
                if (el.innerHTML != ' ') {
                    rStr += el.innerHTML.replace(/ /g, ' ') + ','
                }
            })
        }
        return rStr.replace(/.$/, "");
    };

    if (sender.pagingBar) {
        sender.pagingBar.add({
            xtype: "tbtext",
            text: "",
            id: sender.id + "_summaryStr"
        });

        sender.getStore().on('datachanged', function() {
            if (Ext.get(sender.id + "_summaryStr")) {
                Ext.get(sender.id + "_summaryStr").setHtml(sender.getSummaryStrs(sender))
            }
        });
    }
}

 

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...