Navigate to the row that contains a specific string or date
Navigate to the row that contains a specific string or date
Linvix 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.
This discussion has been closed.
Answers
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
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.
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
Yes!
I want to jump to a specific row that contais today's date!
Thank you !
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
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.
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.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.
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.
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.
Can you help me do that?
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.
Actually, I can not do the change.
What parameters do I need to have to do this?
Who knows, I'll send the link, so maybe you can help me, if possible of course.
@colin, Sorry, can you help me?
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