on 01-04-2017 9:31 PM
I have a list of StandardListItem elements under a Grid and would like to bind them to a json file using a json model.
This is how I do the binding in my controller
var pricingModel = new JSONModel("./model/evaluation.json");
//set model(s) to current xml view
this.getView().setModel(pricingModel, "pricingModel");
This is a snippet of my xml view where I'm trying to bind my data.
<l:Grid class="sapUiSmallMarginTop"
id="priceEvalGridContainer" visible="false"
binding="{/PriceEstimate}">
<l:content>
<l:VerticalLayout id="priceEvalCol1" width="100%">
<StandardListItem title="NSN"
info="{NSNID}"/>
<StandardListItem title="DLA Price Estimate (DLA)"
info="{DLAPriceEstimate}"/>
<StandardListItem title="Proposed Price"
info="$20.00" />
</l:VerticalLayout>
<l:VerticalLayout id="priceEvalCol2" width="100%">
<StandardListItem title="$ Difference From DLA" info="$1.50" />
<StandardListItem title="Total Price Difference" info="$135.00" />
<StandardListItem title="PPI Price Adjusted For Inflation" info="$18.59" />
</l:VerticalLayout>
</l:content>
</l:Grid>
I have hard-coded a lot of the values as I haven't been able to properly connect the data. The only items being tested for now are info="{NSNID}" and info="{DLAPriceEstimate}"
I've seen examples on how to bind a StandardListItem or a Grid, but haven't seen it being done together.
I tried doing the binding in the following way but it didn't work for me.
<l:Grid class="sapUiSmallMarginTop"
id="priceEvalGridContainer" visible="false"
binding="{
path: '/PriceEstimate'
}">
The app runs with no problems and there are no errors being shown, however the data does not show up in the grid. It's all blank.
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.