Okay
  Public Ticket #2498649
sumation
Closed

Comments

  • brett started the conversation

    How do I remove the summation sign and the equals sign from a calculated field with the shortcode? I want to integrate the actual number calculated as a dynamic tag and cant.


    Also, it seems that use the SUM syntax in writing my own MYSQL queries? 

  • brett replied

    following up here

  •  2,572
    Aleksandar replied

    Hello Brett

    No need to follow up, as soon as we get to your tickets we will respond. There is an increased amount of tickets coming in, so our response times are longer than usual. Also, we don't work on weekends, and our working hours are Mon - Fri from 10:00 - 17:00.

    I believe you'd like to add some text to it as well, right? Something like "The table has 600361 rows"?

    If this is true, then let me show you how to do it with some CSS.

    My table has 21 rows, so if I use the [wpdatatable_sum table_id=1 col_id=1] shortcode with the text, it comes up like this:

    4168080306.png

    "The table has" is stored like this:

    1675861636.png

    So, you have to right click on the <p> go to Copy/Copy Selector, which comes back with this:

    #post-10 > div > p:nth-child(2)
    

    Then, we move to "∑ =". You'll see this:

    8561241547.png

    Right-click on "wdt-column-sum" Copy/Copy Selector. I got this:

    #post-10 > div > div > strong
    

    Also, you will have to use the wdt-column-sum to get it to display inline.

    After that, move to "rows":

    8942251290.png
    #post-10 > div > br
    

    So, the final output would be:

    <style>
    #post-10 > div > div > strong {
    display: none !important;
    }
    #post-10 > div > br {
    display: none !important;
    }
    #post-10 > div > p:nth-child(2) {
    display: inline !important;
    }
    .wdt-column-sum {
    display: inline-block !important;
    }
    </style>
    The table has [wpdatatable_sum table_id=1 col_id=1] rows.

    And this is how it looks on front-end:

    7395534398.png

    You should be able to use the whole CSS I pasted here, no need to search for selectors. I just wanted to break it down, so you understand what's happening.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables