on 07-03-2015 1:33 PM
I'm trying to get single porperty value into variable from JSONModel and I just cant get it right.
var jsonSetTableModel = new sap.ui.model.json.JSONModel();
jsonSetTableModel.loadData(link);
console.log(jsonSetTableModel);
I tried like this jsonSetTableModel.getProperty("/d/results/NARTIFACT_ID");
This returns null, what am I doing wrong?
Hello! How are you?
In this case I know that zero (0) is the index of the array, but what if I in this case wanted to search inside json when NARTIFACT_ID is equal to "123456789" for example. How do I do that? I want to "do a json search" and return a single record.
Thanks a lot.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Mijodrag
the path should be /d/results/0/NAME and /d/results/0/NARTIFACT_ID
so it is
jsonSetTableModel.getProperty('/d/results/0/NAME');
jsonSetTableModel.getProperty('/d/results/0/NARTIFACT_ID');
or get the object
jsonSetTableModel.getProperty('/d/results/0');
Thanks
-D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
var aData = jsonSetTableModel.getProperty("/d/results");
console.log(aData.NARTIFACT_ID);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.