excuse me for my stupid question, but is it possible to do a file upload or to select files within this Special gui framework.

1 answer

Staff May 20, 2017

Yes it is possible.  With the latest zebkit version it should like something the following:

<!DOCTYPE html>
<html>
<head>
<script src='../build/zebkit.js' type='text/javascript'></script>


<script type='text/javascript'>
zebkit.ui.myFilesHandler = function(files) {
// handle files
};

zebkit.require(function() {
eval(zebkit.import("ui", "layout"));

var root = (new zebkit.ui.zCanvas(400, 400)).root.properties({
layout: new BorderLayout(),
padding:6,
border: borders.plain,
kids : {
center: new Button("Upload")
}
});

root.on("//zebkit.ui.Button", function() {
var e = document.getElementById("zebkit.files");
e.click();
});
});
</script>

</head>

<body>
<input type="file"
id="zebkit.files"
multiple style="display:none" onchange="zebkit.ui.myFilesHandler(this.files)">
</body>
</html>

 

#1

Please login or Register to Submit Answer