I am trying to use Krajee's bootstrap fileinput plugin (https://plugins.krajee.com/file-preview-management-demo#) to upload and preview my images, only I can not get the initial rendering via a get call on my server.
I would like the initialPreview property to be filled with my json that I get upstream
<input id="input-id" type="file" class="file file-preview-image file-preview-text" data-preview-file-type="text" multiple="multiple">
$("#input-id").fileinput({
initialPreview: [
"<img src = '" + value.url + "' style='width:213px;height:141px;' title = '" + value.name + "'>",
],
});
0: {name: "56293/small/Capture_du_2019-07-17_10-32-20.png", size: 170871, url: "/image/view/dev_bao-hosts-images/56293%2Fsmall%2FCapture_du_2019-07-17_10-32-20.png"}
1: {name: "56293/small/groupe_160_a_suppr.png", size: 55003, url: "/image/view/dev_bao-hosts-images/56293%2Fsmall%2Fgroupe_160_a_suppr.png"}
2: {name: "56293/small/groupe_160_a_suppr_2.png", size: 55652, url: "/image/view/dev_bao-hosts-images/56293%2Fsmall%2Fgroupe_160_a_suppr_2.png"}
3: {name: "56293/small/mail_ouv-ferm.png", size: 146773, url: "/image/view/dev_bao-hosts-images/56293%2Fsmall%2Fmail_ouv-ferm.png"}
4: {name: "56293/small/paysage.jpg", size: 38491, url: "/image/view/dev_bao-hosts-images/56293%2Fsmall%2Fpaysage.jpg"}
5: {name: "56293/small/supervise.png", size: 64651, url: "/image/view/dev_bao-hosts-images/56293%2Fsmall%2Fsupervise.png"}
6: {name: "56293/small/test_gestionnaire.png", size: 37856, url: "/image/view/dev_bao-hosts-images/56293%2Fsmall%2Ftest_gestionnaire.png"}
7: {name: "56293/small/test_suppr.png", size: 55851, url: "/image/view/dev_bao-hosts-images/56293%2Fsmall%2Ftest_suppr.png"}
8: {name: "56293/small/test_suprr_2.png", size: 55575, url: "/image/view/dev_bao-hosts-images/56293%2Fsmall%2Ftest_suprr_2.png"}
9: {name: "56293/small/unsupervised.png", size: 64860, url: "/image/view/dev_bao-hosts-images/56293%2Fsmall%2Funsupervised.png"}
I suspect that I have to loop with an each to display this but I do not see how to forward it to initialPreview
Thanking you for your help!