Hello,
I am using sap.ui.table.table function to display the table and want it to get filled by local data for testing purpose.
I have create the data.json file under folder json.
{
"data":
[
{
"WO": "123456789",
"Opnumber": "Testing",
"Object": "Garfield says: I hate Mondays!",
"Ordtime": "0000",
"Overtime": "0001",
"Weekendtime": "0002",
"Name": "1 People",
"Completed": "X"
},
{
"WO": "123456789",
"Opnumber": "Hello",
"Object": "Garfield says: I hate Tuesdays!",
"Ordtime": "0003",
"Overtime": "0004",
"Weekendtime": "0005",
"Name": "2 People",
"Completed": " "
}
]
}
Also in the controller, i have written loaded the json file to the Model.
//Create instance of JSON model | |||
var oModel = new sap.ui.model.json.JSONModel(); |
// Load Data | |||
oModel.loadData("json/data.json"); | |||
// set the model to the core | |||
sap.ui.getCore().setModel(oModel); |
And finnaly in the VIEW, i have binded the table with "/data". But still the table is empty.
Please let me know what i else i am not doing.
here is code snippet of my XML view
<Table id="table2"
rows="/data"
selectionMode="MultiToggle"
visibleRowCount="7">
<toolbar>
.... </toolbar>
...
Displaying columns
....
</Table>