Professional Documents
Culture Documents
Then select the Project JsonDemo and create a new folder using the context wizard
Create a new folder named JSON in the Web Content directory of the project JsonDemo
"Price": 150
},
{
"Manufacturer": "Dell",
"Type": "Gaming Mouse",
"Price": 400
},
{
"Manufacturer": "Logitech",
"Type": "Wireless mouse",
"Price": 500
},
{
"Manufacturer": "HP",
"Type": "Optical Mouse",
"Price": 300
}
]
}
}));
// Second column "Type"
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "Model"
}),
template : new sap.ui.commons.TextView().bindProperty("text",
"Type"),
width : "100px"
}));
// Third column "Price"
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "Amount"
}),
template : new sap.ui.commons.TextView().bindProperty("text",
"Price"),
width : "100px"
}));
// Bind model to table control
oTable.setModel(oModel);
oTable.bindRows("/Item");
oTable.placeAt("content");
Right click on the index.html and select the option run on server
Result:
Sushil Sahu
Apr 25, 2016 7:59 AM
Hi Abdul,
Can yiu tell me how json model will get data from database in real time project
Pavan Golesar
Sep 24, 2015 7:54 AM
Short,Simple,Easy one.
Thanks
--PavanG
Michael Appleby in response to Mohit Zanwar on page 10
Sep 1, 2015 3:35 PM
Please create a Discussion with your question. Adding a comment to a blog is not the right vehicle for asking
questions unless it is clarification of some part of the content.
Regards, Mike (Moderator)
SAP Technology RIG
Mohit Zanwar
Sep 1, 2015 7:38 AM
Abdul if i want to fetch data in textview instead of table . how can i achieve it ?
Snigdha Singh
Jul 24, 2015 11:59 AM
Hi,
first get the selected index of the row you want to delete
get the Row context
Splice the data
bind the Data model again to Table
Cheers
Pandu
govardan raj
Feb 24, 2015 7:06 AM
hi abdull,
Thanks for sharing this document , i replicated the same but my table is empty , can u please help me
Regards
Govardan Raj S
Farag Elfadaly
Feb 19, 2015 9:14 PM
Dear VREDDY,
you can retrieve items as array and change it and set it again to the json model:
var items = oModel.getProperty("/items");
var itemEntity =
{
"Manufacturer": "Toshiba",
"Type": "TV",
"Price": 500
};
items.push(itemEntity);
oModel.setProperty("/items", items);
VREDDY S
Jan 23, 2015 6:42 AM
Hi Abdul,
First off all thanks for sharing your information ..
I Just wanted to know ,
How to add , delete and Upadte records in Local JSON table?
Kindly give to me your inputs.
Regards,
VREDDY
Farag Elfadaly
Jan 8, 2015 10:56 PM
Simple and illustrative post
, Thanks.
Syed Nayeemuden S N
Dec 31, 2014 1:56 PM
Good document abdul and Keep on posting..
ramkumar ganesan
Dec 30, 2014 2:10 PM
Worth & Thank you for this useful information !
Mohamed Yosufdeen JMH
Dec 30, 2014 1:28 PM
Nice tutorial...
Jerry Wang
Dec 30, 2014 7:42 AM
very good article, simple and useful
BHARANIDHARAN S P M
Dec 11, 2014 11:23 AM
Simple and nice tutorial
indrasena reddy
Dec 10, 2014 6:25 PM
Good Document for beginners