Okay
  Public Ticket #1375341
wpDataTables
Closed

Comments

  • Jason started the conversation

    Hello,

    I'm strongly considering purchasing wpDataTables, and a big part of my front-end functionality will depend upon using column calculations which then display the resutling column calc result elswhere in the site as a dyamic result.


    For this, it looks like I could use  https://wpdatatables.com/documentation/table-features/calculation-functions/ the parse shortcodes functionality to show a dynamically calculated column sum or average elsewhere in the site.  

    That said, It is also critically important that I can read that same variable value, such as the sum of a certain column, with javascript or jquery.  

    Is it possible to get the value displayed by a dynamic shortcode such as a dynamic calculated column sum, and then use it/display it using javascript?

    TLDR; is it possible to get the results of a table column sum into a usable javascript or php variable for other code/calculations/display?

    Thanks for your advice!

    Jason

  • [deleted] replied

    Hi Jason,
    Thank you for the inquiry.

    You could take a value from SUM, AVG, MIN, MAX shortcode with JavaScript or with jQuery and then store it in some JS variable.

    For PHP it would be little complicated than with jQuery.

    You can try our sandbox site: Front-end & Back-end - you can find a fully functional version there to try out all plugin features.