Jquery文件上传,在页面加载时设置数据

Reference: PHP, Jquery File Upload, Yii, XUpload

Jquery File Upload, retrieving uploaded data and displaying using the UI Template (similar to the template displayed after uploading, purpose is to generate the already uploaded data using the UI Tempalte)

https://github.com/blueimp/jQuery-File-Upload

"set form data on page load"

I already uploaded files and these files are automatically viewed using js_encode of the file properties and xupload immediately shows them on template. But how will I have the same view/result when I visit again the page next time (assuming files were already uploaded and the upload start has not yet run)?

I tried doing an echo js_encode of the same properties in the controller. Instead, it just printed out the data and was not read by the xupload, unlike what happens right after uploading files.

Am I missing something? I've been reading, but haven't found any answers yet.

I have no easy way in mind to do this, but i think the easiest way to do this, is to inspect the code, and how its build and do the same in your view, using the same classes should trigger the same event binds and the same layout.

I not sure why you want to load the data with js if you already have them in your controller/view in php. dont overdo js, it will only make your users browser slower and the controller is already 'controlling' the data. No i am a Back-end Developer but my Front-end colleagues always tell me : "Avoid DOM manipulation if not needed, it will make client side slower and it might turn out differently in every browser"