How do you change Subtotal lable name

Comments

3 comments

  • Avatar
    Katie Garrison

    Hi Courtney,

    Changing the subtotal titles is a bit trickier because each subtotal name is different based on what it is aggregating on.

    What specifically do you want to change the subtotal titles from vs. to? Is it something that is applicable to all subtotals?

    1
    Comment actions Permalink
  • Avatar
    Tonya True

    I am looking for a similar solution.  I added 01, 02 based off the order in which i needed items.i was able to remove the 1st 2 characters from the pivot widget but the sub-total lines still have the 01Cash, 02Credit Cards, etc.  I need the 01 & 02, to be removed.

     

     

    0
    Comment actions Permalink
  • Avatar
    Jake Kwok

    Hello Tonya,

    I think for what you are trying to accomplish you can use the follow Javascript on the widget level. I applied the function again to remove the subtotal.

     

    var columns = ['0', '1']; //This is an array you can choose a specific column

    widget.on('ready', function(w, args) {
    for(var x = 0; x<columns.length; x++)
    {
    var tags = $('td.p-dim-member[fidx=' + columns[x] + ']', element);
    for(var i=0; i<tags.length; i++) {
    $('span', tags[i]).text($(tags[i]).text().substring(2)); //this line of code removes a character
    }
    }
    });
    widget.on('ready', function(w, args) {
    for(var x = 0; x<columns.length; x++)
    {
    var tags = $('td.p-total-row-head[fidx=' + columns[x] + ']', element);
    for(var i=0; i<tags.length; i++) {
    $('span', tags[i]).text($(tags[i]).text().substring(2)); //this line of code removes a character
    }
    }
    });
     
    -JK

     

     

    1
    Comment actions Permalink

Please sign in to leave a comment.