WordPress.org

Ready to get started?Download WordPress

Forums

TablePress
[resolved] Sort decimals which are linked (9 posts)

  1. fenomeno0chris
    Member
    Posted 1 year ago #

    Hello,
    first thank you very much for this great plugin!

    I have a problem to sort correctly my columns (Retail | Download). Of course I already downloaded and installed "DataTables Sorting plugins".

    In my case I added the following code, to the “Custom Commands” textfield:

    "aoColumnDefs": [ { "sType": "numeric-comma", "aTargets": [ 3, 4 ] } ]

    I think it´s not working, because the decimal numbers are linked.
    Is there a way to solve this problem?

    http://www.psvsource.de/ps-vita-spiele/

    cheers chris

    http://wordpress.org/extend/plugins/tablepress/

  2. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Chris,

    thanks for your post, and sorry for the trouble.

    Yes, the reason for this is that your data is a currency value, that use the comma as the demical separator, and that is linked (i.e. it is HTML)...
    Due to that, a much more sophisticated sorting detection is required that is currently not part of TablePress or the Sorting Plugins Extensions.
    I do have an idea of how that has to look like, and I'll try to find a solution to this tomorrow.

    Regards,
    Tobias

  3. fenomeno0chris
    Member
    Posted 1 year ago #

    Wow, thanks for this fast answer! I hope you can manage this.

    cheers Chris

  4. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Chris,

    good news, the new Extension is ready. Please install the Extension from http://tablepress.org/extensions/datatables-numhtml/ and add this to the "Custom Commands" textfield in the "Features of the DataTables JavaScript library" section on the "Edit" screen of the table:

    "aoColumnDefs": [ { "sType": "num-html-comma", "aTargets": [ 3, 4, 5 ] } ]

    instead of the

    "aoColumnDefs": [ { "sType": "numeric-comma", "aTargets": [ 3, 4 ] } ]

    that you have now.

    Regards,
    Tobias

  5. fenomeno0chris
    Member
    Posted 1 year ago #

    Hi,
    still not working. The 4th and 5th column are not sortable at all. I have deleted the 5, because my last column works actually perfectly. But those two others still don´t work.

    Is ist maybe not working because of other installed extensions?
    Those extensions are installed:
    - TablePress Extension: DataTables FixedHeader
    - TablePress Extension: DataTables HTML Numbers in Tables
    - TablePress Extension: DataTables Sorting plugins
    - TablePress Extension: Table Row Order

    cheers Chris

  6. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Chris,

    ah, my bad. I had uploaded the wrong (old) version of the Extension to the website. Please download/install the Extension from http://tablepress.org/extensions/datatables-numhtml/ again.

    And yes, you can leave out the 5 from the "Custom Command", as long as the values are just integers.

    Regards,
    Tobias

  7. fenomeno0chris
    Member
    Posted 1 year ago #

    Wow!!
    You are amazing. It works perfectly now.

    There is one question I still have.
    Is it possible to increase the font size of the column heading? I couldnt find any extension to do so.

    cheers and thanks again
    chris

  8. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Chris,

    great to hear that this worked :-)

    Increasing the font size is possible with "Custom CSS", just like you have changed the font of the regular table cells.
    Just extend your "Custom CSS" on the "Plugin Options" screen to

    .tablepress-id-1 thead th,
    .tablepress-id-1 tbody td {
    	font-family: Arial;
    	font-size: 14px;
    	color: #000000;
    }

    But actually, that might not be necessary, if you fix another small problem:
    Please go to the "Edit" screen of the page (where you entered the Shortcode), and switch from the "Visual" to the "Text" editor. You will see something like

    <pre>[table id=1 /]</pre>

    Just remove the HTML and change that to

    [table id=1 /]

    After that, you might not need the "Custom CSS" at all, as the table will get the default font of your theme.

    Regards,
    Tobias

  9. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    and one more thing: Instead of setting the initial number of rows to 100, you could deactivate Pagination entirely, by simply unchecking the checkbox for it.

    Best wishes,
    Tobias

    P.S.: In case you haven't, please rate TablePress here in the plugin directory. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic