angularjs - How to load image preview after sucessful post (Krajee bootstrap file-input plugin) -


i'm using krajee bootstrap file-input plugin , want displayed images after successful post. it's not working. code:

var resulttailieu = hopkhonggiay_sapxeplichhop_service.getalltailieucuochopbymacuochop(calevent.id);             resulttailieu.then(function (p1) {                 var result_json = json.parse(p1.data);                 console.log(json.stringify(result_json));                 $("#fileupload").fileinput({                     initialpreview: result_json                 });             }) 

console.log

["<img src='http://localhost:51157/documents/5f189c85-238d-4e8d-a406-3f4ee83ac965_untitled2.png'","<img src='http://localhost:51157/documents/53c8a2e5-d031-4617-a020-c99da79aa72a_untitled3.png'"] 

updated: add attribute "refresh" file-input

$("#fileupload").fileinput('refresh', {                         initialpreview: result_json                     }); 

your result formatting incorrect. result needs contain link place saved images, not img tag.

["http://localhost:51157/documents/5f189c85-238d-4e8d-a406-3f4ee83ac965_untitled2.png","http://localhost:51157/documents/53c8a2e5-d031-4617-a020-c99da79aa72a_untitled3.png"]

Comments

Popular posts from this blog

How to run C# code using mono without Xamarin in Android? -

html - grunt SVG to webfont -

c# - SharpSsh Command Execution -