sets the component to display values of the files chosen for upload
webix.ui({
view:"form",
rows:[
{
view:"uploader",
value:"Upload file",
link:"mylist", //ID of the linked list
upload:"php/upload.php"
},
{
view:"list",
id:"mylist",
type:"uploader" //defines config of each list item
}
]
});
The component should have appropriate configuration to display file properties. In case of list, just define a built-in "uploader" type for it, which includes the needed template, upload state vizualization, remove icon and click behavior.
You can as well create a custom type by extending any component that can display data with necessary properties:
webix.type(webix.ui.list, {
name:"custom_name",
template:"#name# {common.removeIcon()}{common.percent()}\
\<div style='float:right'>#sizetext#</div>",
percent:function(obj){...},
removeIcon:function(obj){...},
on_click:{...}
status:function(f){
var messages = {
server: "Done",
error: "Error",
client: "Ready",
transfer: f.percent+"%"
};
return messages[f.status]
}
});
Don't forget to set your custom type for the linked list.
webix.ui({
view:"list",
type:"custom_name"
...
});
More about type implementation.