Created
January 20, 2019 22:11
-
-
Save Salman2301/f91cb2ef8bd7416668a17f3d69aca60b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Upload multiple image and display it on a repeater | |
$w.onReady(function () { | |
let image = []; | |
$w('#repeater1').data = []; | |
let _id = 0; | |
$w('#uploadButton1').onChange(() => { | |
let name = $w('#uploadButton1').value[0].name; | |
if ($w('#uploadButton1').value !== '') { | |
$w('#uploadButton1').startUpload().then((val) => { | |
console.log(val); | |
_id++ | |
image.push({ | |
'image': val, | |
'name': name, | |
'_id': String(_id) | |
}); | |
$w('#uploadButton1').value = ''; | |
repeat(); | |
}) | |
} | |
}); | |
function repeat() { | |
$w('#repeater1').data = image; | |
$w('#repeater1').onItemReady(($item, itemData, i) => { | |
$item('#image10').src = itemData.image.url; | |
$item('#text1').text = itemData.name | |
}) | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment