• Resolved rc169

    (@rc169)


    I am displaying a table with several records, with a few fields that show the same values for each record. I want to use the common values as an “header” above the main table, so I have created a separate entry in the “Table builder”, and I display this table on the page, above the main table with the detail rows.

    This functions as required, but the headers are displayed as many times as there are rows in the main table, so I would like to know how to display that record just once. In effect, I need to know how to replicate a “select distinct” query, but it would presumably also achieve the desired result if the upper view table showed just one row.

    Can you advise how I can achieve this? Thanks in advance for your help.

    Nigel

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Kim L

    (@kimmyx)

    Hi Nigel,

    You can create a view for your query and use that as a table source in your data table, or directly use Custom Query as a data source.

    Do you have a public link for this table so we can take a look?

    We’ll wait for your response. ??

    Thread Starter rc169

    (@rc169)

    Hallo Kim,
    
    Thanks for your prompt response.
    The site is at https://ba3.nwframpton.com/ XQBc6oPq
    Please select "Search for a route" Enter:- Operator = First Primary town = Leeds Service number = 2 On the next page, click on "Archive Path" On the next page, the upper table has the same number of rows as the lower table, but all are the same (First - 2 - Middleton-Leeds-Roundhay). I want to display just one row in the upper table.
    Ideally, I would like to hide the display of the show number of entries, and the pages at bottom right. The second table needs to show all of the rows since these vary. Thanks again for your help. Nigel
    Plugin Contributor Kim L

    (@kimmyx)

    Hi Nigel,

    Thanks for the link and instructions to see your tables.

    Ideally, I would like to hide the display of the show number of entries, and the pages at bottom right.

    To hide those elements from your table, please add the following code to your table’s Advanced Settings inside { }:

    "dom": "rti"

    The second table needs to show all of the rows since these vary.

    To load all entries at once without pagination, add the following:

    "paging": false

    Your Advanced Settings should look like:

    {
    "dom": "rti",
    "paging": false
    }

    Let us know if you have more questions. ??

    Thread Starter rc169

    (@rc169)

    Hi Kim,

    Thanks for that information. In the “Advanced settings” page, I also found the command to show just one row in the upper table – which was the main issue in this case.

    A couple more questions arise in my mind. Firstly, the “Advanced settings” page ( https://wpdataaccess.com/docs/data-tables-advanced-features/advanced-settings/ ) has some examples of the use of JSON, but my understanding is that these are not all of the possibilities. Is there a comprehensive documentation showing all (or most) of the available settings? The general JSON documentation seems to cover several different topics and approaches, but I presume that not all of those are relevant in WPDA.

    Secondly, I have only briefly looked at the “Data projects” documentation in WPDA ( https://wpdataaccess.com/docs/data-apps/data-projects/ ), and I am wondering if the creation of a project might be a more suitable approach in this case?

    Thanks once again for your prompt and efficient help!

    Nigel

    • This reply was modified 1 year, 5 months ago by rc169.
    Plugin Contributor Kim L

    (@kimmyx)

    Hi Nigel,

    We’re happy to know you were able to see the solution for your initial issue.

    Is there a comprehensive documentation showing all (or most) of the available settings??

    Data Tables is built with JQuery Datatables and you can find more options you can use in your advanced settings here: https://datatables.net/reference/option/

    I am wondering if the creation of a project might be a more suitable approach in this case?

    Data Projects is mainly used if you want to transact with your table (Insert, Update, Delete). This functionality is built using a different dependencies, so you won’t be able to use the options you have set in your Advanced Settings.

    Hope that helps! Let us know if you have more questions. ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Use “select distinct” clause’ is closed to new replies.