multiple image uploader (Delete + edit) DT-edtior

multiple image uploader (Delete + edit) DT-edtior

sarath_surisettysarath_surisetty Posts: 54Questions: 13Answers: 0

hello team

continuation to the discussion at https://datatables.net/forums/discussion/48925/datatables-editor-file-upload-with-spring-boot

->when i click on delete button how to make ajax call to remove the file ?
->on clicking on edit how to reload the paths and call delete.

thanks
sarath

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 61,934Questions: 1Answers: 10,155 Site admin
    Answer ✓

    ->when i click on delete button how to make ajax call to remove the file ?

    There is no option for that at this time. The way it currently works is that the reference to the file is removed from the value array for that field. When that value gets written to the database the file that was removed is then orphaned and can be removed.

    ->on clicking on edit how to reload the paths and call delete.

    That isn't a feature of the uploadMany input either. If you need that ability, you'd need to create a custom field plug-in.

    I don't understand why the paths would need to be reloaded on edit?

    Allan

  • sarath_surisettysarath_surisetty Posts: 54Questions: 13Answers: 0

    hi allan thanks for answering.
    I don't understand why the paths would need to be reloaded on edit?
    ->i mean how to display the images bonded with the parent row,as it is OnetoMany .

  • allanallan Posts: 61,934Questions: 1Answers: 10,155 Site admin

    Do you mean in the table or in the form?

    Allan

  • sarath_surisettysarath_surisetty Posts: 54Questions: 13Answers: 0

    in the form.actually the example has this feature:

    https://editor.datatables.net/examples/advanced/upload-many.html

    but im checking how to implement with spring boot using ajax.
    please find attachment for screenshot

  • allanallan Posts: 61,934Questions: 1Answers: 10,155 Site admin
    Answer ✓

    From a client-side point of view there shouldn't be any difference from the example you linked to. The render function of the uploadMany callback is the method that will run when the field needs to display an image. In that example it uses file() to get file information. Assuming you populate file information into the JSON response, then you can use the same method.

    Allan

This discussion has been closed.