Reloading a single DIV

Tags: #<Tag:0x00007fee37e7f090>

I have a table with about 500 data rows. The table is recording input from all employees of the organization about their New year resolution for the first half of the next year.
Columns in the table:

  1. Employee Name
  2. ID
  3. Resolution name
  4. Resolution update (after 3 months)
  5. Final result
  6. Ranking and
  7. Three more columns with “LIKE BUTTON” (each for Resolution name, update and final result).

LIKE BUTTON is similar to Instagram likes and is displayed as a division using inneHTML.
My concern is, I am already using a custom renderer to initialize the innerHTML into the table. I am storing the likes in a separate backend PHP file than the table’s data file.

I know that there is a way to reload only the specific division using:
I have used this and renders the entire table itself which is fine for me, but then it should also take me back o the same cell, I was looking at.

For example, if I was at row 100 and I liked another employees Resolution at row 100, it should display the same row on reloading the table. Is there any way to do that?

I am sorry if I am bad at explaining questions.
(I edited the question to make more sense, apologies)

Hi @param556

Thank you for detailed description. If I understood correctly I think that the method you are looking for is scrollViewportTo that will allow you to jump to the chosen row after the reload. Would that help you to solve the issue?

Thank you for your reply. I used the scrollViewportTo and achieved the results. But looks like there is a delay if someone wants to render a cell and use scrollViewportTo. So I dropped the method and just used toggle class for the LIKE BUTTON and a full render on the entire column. Just try to check when you guys have time, why render and scrollViewportTo have a lag when used together sequentially. I’ll try to give you guys a fiddle in a day or two during the winter holidays.

Hi @param556

Should we keep this issue opened, or it’s already sorted out?

Hey! I’m sorry for the trouble. Gimme about a week, once I finish what I planned to achieve closing it would be helpful.

OK, no problem.

Is there any way to get the initial index of a row after filter_by_value

For ex: I have 50 rows, I am going to search for my name (let’s say is in the 40th row). On searching, by default when the result is loaded, the row index becomes 0,1,2,3 and so on. Is there any way, that even though the table might show row 0, 1, 2, 3, etc. I should be able to use the row index value as 40 (the initial value before search)

Hey @param556

by the initial row, do you mean the row index that was set while loading the data? If so you can use those method to get physical row and column index

1 Like

Hey @aleksandra_budnik Thank you for letting me know about this. I have tried it and it worked.
I had seen it earlier, but the sentence framing in the documentation confused me.

Suggestion for documentation:
In the documentation it is mentioned Visual row index, the meaning of this word can quiet confuse people (specially rookies like me) who are searching for the answer as it means the row index that is visible. In my case you can see that upon searching the row index that is visible, changes (from 40 to 1). So if someone is searching for a solution like mine, may get confused “Oh this says visual row index, this is not what I need”
This is just a suggestion for the change in documentation if you can do it.

Thanks again for the help!

Thank you for the suggestion. I will share it with our Technical Writer.

1 Like