Searching for Latest (most recent) Date

Searching for Latest (most recent) Date

MartinZMartinZ Posts: 5Questions: 1Answers: 0

Hi, I'm using Datatables and SearchPanes since some time now in different projects, the quality of code and documentation is outstanding. Thx!

Having said this, I thought: why not asking a very special question

I have a DataTable with a SearchPane on a Date-Column, some rows could be grouped by another column (building-id) (its in German, but that doesn't matter).

I now would like to additionally have the Option "LATEST" in the Date-SearchPane which should select only the most recent row from each of this row group

Example Data
<th>building-id</th><th>date</th>
<td>NW3.3</td><td>2022-10-14</td>
<td>NW3.3</td><td>2022-09-28</td>
<td>NW3.4</td><td>2022-09-28</td>

I now would like to have additionally to the dates a LATEST in the SearchPane for the date column which selects 2022-10-14 for NW3.3 and 2022-09-28 for NW3.4 BUT NOT 2022-09-28 for NW3.3

Please apologize if I think to complicated, I assume there is an easy solution out there well hiding from me, I appriciate it very much if you'll help me

Martin

Replies

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin

    Hi Martin,

    I don't think there is a trivial way to do what you are looking for I'm afraid.

    Let's take this example so I can understand more completely what you are looking for. Do you want a button somewhere on the page that says "Latest" and it will pick the newest entry a pane for the "Start date" column.

    Is that right, or have I misunderstood?

    Allan

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    If you have panes for both the office and the date, when you select the building in its pane, you can define the default ordering for the date so that the latest is always on top. Would that give you what you want?

    Colin

  • MartinZMartinZ Posts: 5Questions: 1Answers: 0

    Hi allan, I'll think about the button, maybe that is what I want sounds intereseting. I check if I can describe my problem with a "button"

    Hi colin, I know that I can define the sort order - but this still leaves the second and further rows in the table. I would like to hide (not show) those somehow

Sign In or Register to comment.