Navigate to the row that contains a specific string or date

Navigate to the row that contains a specific string or date

Linvix SistemasLinvix Sistemas Posts: 10Questions: 1Answers: 0

Hello, thanks for you attention.

I have a table with serverside processing, I would like to bring a selected row to the server side, how do I do this?

It may be after I load the table, with a search or something.

Answers

  • colincolin Posts: 15,236Questions: 1Answers: 2,598

    Hi @Linvix Sistemas ,

    The way to do that would be to use ajax.data, this will allow you to add data to the Ajax request. This example here will show you how to get the selected rows.

    Cheers,

    Colin

  • Linvix SistemasLinvix Sistemas Posts: 10Questions: 1Answers: 0

    Hi @colin, thanks for you attention.

    Unfortunately I do not think that's what I need.

    For example, I have a table with several financial records, but the records I need to load in today's position.

    Only I have records until 2020 for example, and if I sort by decreasing maturity date will appear the records started in 2020.

    I need to load the table on the page with today's dates.

    I do not know if you understood me.

  • colincolin Posts: 15,236Questions: 1Answers: 2,598

    Hi @Linvix Sistemas ,

    OK, I think I'm getting it. When the table loads, you want to jump to a specific row that contains today's date? Or, do you want to not load specific rows that are newer than today's date?

    Cheers,

    Colin

  • Linvix SistemasLinvix Sistemas Posts: 10Questions: 1Answers: 0

    Yes!

    I want to jump to a specific row that contais today's date!

    Thank you !

  • colincolin Posts: 15,236Questions: 1Answers: 2,598

    Hi @Linvix Sistemas ,

    Sorry for the confusion there, you did say that in the thread topic!

    This plugin here will do the trick. See this example that's using it.

    Cheers,

    Colin

  • Linvix SistemasLinvix Sistemas Posts: 10Questions: 1Answers: 0

    Hi @colin, Thanks!

    It's coming!
    But for my tests it did not work with server side processing.
    Can you adjust it?

    Or maybe put the table with scroller.

  • colincolin Posts: 15,236Questions: 1Answers: 2,598

    We're getting muddled here - you're right, it won't work! With server side processing, only the required data is sent, the client has no knowledge of the other rows. So this goes back to my first response, you need to send the date you would want to the server in the Ajax request.

    Scroller has row().scrollTo() if you know the line number.

  • Linvix SistemasLinvix Sistemas Posts: 10Questions: 1Answers: 0

    Okay, how do I send the date and bring in the correct line directly from the server side?
    I really have no idea how to do this.

    I also do not know the line number that contains the current date.

  • colincolin Posts: 15,236Questions: 1Answers: 2,598

    See the first reply on how to send the date - you would do this when the table first loads. You would then need to modify the server scripts to check for that date value, and if present return records starting at that point.

  • Linvix SistemasLinvix Sistemas Posts: 10Questions: 1Answers: 0

    Okay, I do not know how to change the output to start with the date, send parameters to the server side, I can. customize the return, no.

  • Linvix SistemasLinvix Sistemas Posts: 10Questions: 1Answers: 0

    Can you help me do that?

  • colincolin Posts: 15,236Questions: 1Answers: 2,598

    It will depend on your tables - the logic would be similar to when a client requests a specific page. You just need to determine which page that it is based on the date being sent.

  • Linvix SistemasLinvix Sistemas Posts: 10Questions: 1Answers: 0

    Actually, I can not do the change.

    What parameters do I need to have to do this?

  • Linvix SistemasLinvix Sistemas Posts: 10Questions: 1Answers: 0

    Who knows, I'll send the link, so maybe you can help me, if possible of course.

  • Linvix SistemasLinvix Sistemas Posts: 10Questions: 1Answers: 0

    @colin, Sorry, can you help me?

  • allanallan Posts: 62,992Questions: 1Answers: 10,367 Site admin

    What I think you'd need to do here is make an Ajax call (before you initialise the DataTable) to get the location of the current date in the data set, then use that as the displayStart option.

    With server-side processing the data set is at the server, so only the server can know where the start point of the data would be.

    Allan

This discussion has been closed.