Hello world !,
Guys how can i upload images in order by Drag and Drop ? I know the plugin “FileInput” but i can’t change the order before upload the images
Thanks!
Hello world !,
Guys how can i upload images in order by Drag and Drop ? I know the plugin “FileInput” but i can’t change the order before upload the images
Thanks!
i solved with “filesorted” event, i send post with the params “params.previewId, params.oldIndex, params.newIndex, params.stack” and resort in the backend. I don’t know if this is the best way but works fine
thanks
'pluginEvents' => [
'filesorted' => 'function(event, params) {
var orden = new Object();
orden["old"]=params.oldIndex;
orden["new"]= params.newIndex;
orden["set"]='.$model->idvehiculo.';
orden["stack"]=params.stack;
$(".file-input").addClass("disabledbutton");
$.post("http://localhost/bitbucket/controller/view", {suggest: orden}, function(result){
if(result.success == "ok")
$(".file-input").removeClass("disabledbutton");
});
console.log("File sorted ", params.previewId, params.oldIndex, params.newIndex, params.stack);
}',
]