Closed sebasira closed 4 years ago
I think what I would need is a @Repository
method to get a DataTablesOutput
for a single item, like a findOne instead of a findAll.
As a workaround I will try using Specification
that will give me a single element, the one I want. I'll keep you posted
Well, I manage to get what I wanted: return the newly edited row from the server as a DataTablesOutput
... but it was all in vain 😢
Further reading make me realize that as I'm using server-side processing every-time I call the draw()
function it will re-draw the whole table, or just the page I'm in if I'd like to, but there's no way to only draw the new row.
So what I wanted was to avoid the ajax call to re draw the whole table but it can not be done if server side processing is enabled.
Hi! Could you guide me on how can I redraw a single row instead of the whole table?
Suppose I have a button in the table that toggles the active estate of the element in that row (there's an
active
attribute in the object used in the datatable and via AJAX I set it to true or false. Right now in the AJAX response I'm re-drawing the whole table.For some applications that's fine but now I would like to only refresh/redraw the row in question.
I've read this and this, but I do not figure out how I should return the row from the AJAX response.
Should I use a
DataTablesOutput
object? Thank you very much!If you need to, assume the following object to be displayed in the datatable: