Okay
  Public Ticket #952331
Display table content
Closed

Comments

  •  2
    Wouter Blacquière started the conversation

    Dear Sir, Madam,

    There are two questions that I would like to ask you about displaying table content using MySQL query.

    1) How can I adjust the width of the column to automatically adapt to the width of the content?

    2) How can I at first display only a filtered selection of the database content but at the same time still have the select box option to later select database content with a different value?

    ("SELECT * FROM table WHERE column='value'  " limits the select box options "SELECT * FROM table" gives too much content at first but does give the website user all the options in the select box.
    Is it possible to use php session to preload a certain value and then query something like "SELECT * FROM table WHERE column=$selected_option" ?)

    I hope that my questions are clear for you. I really like your plugin and would like to use it for the above purpose.

    Best wishes,

    Wouter.

  • [deleted] replied

    Hi Wouter Blacquière,
    Thank you for your purchase.

    1. You can enable Scrollable option in table Additional settings

    2. There is a Default value(s) field where you can predefine filter value in Optional column setup (Please take a look at image from the attachment). 

    "Predefined filter value, default editor input value. Separate multiple values with "|". Placeholders supported."

    You can try with Default value(s) and if this doesn't do what you need please explain me this in more details.

  •  2
    Wouter Blacquière replied

    Hi Milos,

    Thank you very much for your quick and helpful message. It worked!

    I would like to ask you two more questions. I attached a screenshot of a table with two select boxes.

    1) Is it possible to make the width of the drop down menu wider? As you can see in the screenshot, the scroll bar in the dropdown menu is blocking some of the content of the drop down menu.

    2) Is it possible to change the content of the first select box based on the selected value of the second select box?

    Best wishes,

    Wouter.

  • [deleted] replied

    Hi Wouter Blacquière,

    1. Yes, please send me a link of your table and I will provide you CSS that you have to insert to make dropdown wider.

    2. For now this is possible just with custom coding. We are planing to implement this feature in version 2.0 that should be released at the beginning of next year.

  •  2
    Wouter Blacquière replied

    Hi Milos,

    Thanks again for your quick response!

    1) The link of the page where the table is displayed is: http://de18minutenman.nl/intern/ If you meant another link, please let me know.

    2) That's fantastic! I will be happy to wait until the beginning of next year for the new feature. For now, the custom coding is not necessary.

    Also, is correct that the more records I preload in the table page (SELECT * FROM table, etc) , the slower the page loads? I am finding that loading around one thousand records takes around two of three seconds to load. Once the records are loaded, the plugin is lightning quick. But is there a way to preload the database data faster? Or is this just part of WordPress database communication?

    Best wishes,

    Wouter.

  • [deleted] replied

    Hi Wouter Blacquière,

    You can add this CSS in Custom CSS field on wpDataTables settings page or directly on this page if you don't want to effect on other tables:

    #table_1 > thead > tr:nth-child(2) > th:nth-child(12) > span > div > div {
        min-width: 110px !important;
    }
    

    If you are using MySQL tables and have a lot of records you should enable Server-side processing. Like that just records that are show on the page are loaded, what is not case when Server-side processing is disabled. When it is disabled all records will be loaded once.

  •  2
    Wouter Blacquière replied

    Hi Milos,

    Thanks again for your response. Your service is really helpful!

    1) The CSS code is working. Great!

    2) When I enable server side processing for the MySQL-table, the full table content is loaded and shown. It seems that the default value is no longer being taken into account. Also, the select box menu is empty. Is there anything else I need to do?

    Best wishes,

    Wouter.

  • [deleted] replied

    Hi Wouter Blacquière,

    When Server-side processing is turned on you should click Create from column values button in optional column setup and you will have all filter values.

  •  2
    Wouter Blacquière replied

    Hi Milos,

    Thank you for your answer. It solved the content of the select box menu.

    However, enabling the server side processing still loads and displays the full content of the table, even though a default value has been set. Is there anything that can be done to correct this?

    Best wishes,

    Wouter.

  • [deleted] replied

    Hi Wouter Blacquière,

    Please provide me a temporary WP-admin login for your site where this happens, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue. We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course we do not provide login data to third party. You can write credentials here just check PRIVATE so nobody can see it except us.

  •   Wouter Blacquière replied privately
  • [deleted] replied

    Hi Wouter Blacquière,

    "Table 4 server side processing is enabled and create from column tables has been pressed. The select box drop down menu is now filled, but there are no results loaded and displayed. Default value has been set."
    - You shouldn't use ORDER BY in query because we are using it when you select Ascending or Descending option in Optional column setup.


    "Table 3 server side processing is enabled but create from column has not been pressed. The select box drop down menu is now empty, but the full table results are loaded and displayed. Default value has been set."
    - I just clicked Create from column values and not Dropdowns are filled with values and also Default Value is set.

  •  2
    Wouter Blacquière replied

    Hi Milos,

    I just realised that I forgot to say thank you. So: Thank you for all your effort! You helped me out very well.

    Best wishes,

    Wouter.

  • [deleted] replied

    Hi Wouter Blacquière,

    You are welcome. We'd greatly appreciate it if you could take a minute and leave a review on CodeCanyon on this link. Thanks!