Hi,
this basic code adds items to the end of an observable list. How do i add items to the beginning of the list ?
<App Theme="Basic">
<JavaScript>
var Observable = require("FuseJS/Observable");
var item = Observable();
var i = 0;
function addItemBottom(){
i = i + 1;
item.add({text: i.toString()});
}
function addItemTop(){
i = i + 1;
// ???????
}
module.exports = {
addItemBottom: addItemBottom,
addItemTop: addItemTop,
item: item
}
</JavaScript>
<StackPanel>
<Button Text="Add botom" Clicked="{addItemBottom}"/>
<Button Text="Add top" Clicked="{addItemTop}"/>
<Each Items="{item}">
<Panel Margin="0,5,0,5" Background="#f0f">
<Text Value="{text}"/>
</Panel>
</Each>
</StackPanel>