Hi,
I have JSON that is filled out during init function.
Example, I have JSON
onInit: function() {
var list = {
ablist: [
{
name: "Test",
age: "TestAge"
}]
};
var oModel = new JSONModel(list);
this.getView().setModel(oModel);
this.fillJSON();
},
fillJSON: function(){
//function that pushes more data to JSON
}
My view is:
<t:Table id="table"
selectionMode="MultiToggle"
visibleRowCount="7"
enableSelectAll="false"
rows="{
path: '/ablist'
}"
threshold="15"
enableBusyIndicator="true">
<t:noData>
<BusyIndicator class="sapUiMediumMargin"/>
</t:noData>
<t:columns>
<t:Column width="{ui>/widths/name}">
<Label text="Student Name"/>
<t:template> <Text text="{name}"/></t:template>
</t:Column>
</t:columns>
</t:Table>
But when page loads, it only shows one row with "Test". I checked the JSON if it has values with
MessageToast.show(oModel.getProperty('/list/2/name')); and the JSON is populated.
How can I load table AFTER I add data through init function?