Copy ODataModel to JSONModel for use in table
<p>I need to show a list in a table. This list shall be filtered at client-side, and because of that I need to copy the OData model into a local JSON model.</p>

<p>The OData model looks like this:</p>

<p>OData model</p>

<p><a href="https://i.stack.imgur.com/X6FlU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/X6FlU.png" alt="enter image description here"></a></p>

<p>I am able to show the "/ZcountWerksSet" list (from the OData model) inside a table using this code:</p>

<pre><code>oSearchTable.bindAggregation("items", "/ZcountWerksSet", new sap.m.ColumnListItem({
             cells : [
                  new sap.m.Text({
                       text : "{Name1}"
                  }),
                  new sap.m.Text({
                       text : "{Werks}"
                  })
             ]
        }));
</code></pre>

<p>Then I am copying this into a JSON model like this:</p>

<pre><code>            var oModel = this.getView().getModel();
            var oModelJson = new sap.ui.model.json.JSONModel();
            oModel.read("/ZcountWerksSet", {
            success: function(oData, response) {
                oModelJson.setData(oData);
                sap.ui.getCore().setModel(oModelJson, "oJSONModel");
                alert("Success!");
            },
            error: function(response) {
                alert("Error");
            }
        });
</code></pre>

<p>Then the model looks like this </p>

<p>JSON Model</p>

<p><a href="https://i.stack.imgur.com/6Hc1N.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6Hc1N.png" alt="JSON Model"></a></p>

<p>Trying to show the same list (from JSON model this time), in a table using the following code is NOT working:</p>

<pre><code>oSearchTable.bindAggregation("items", "{oJSONModel&gt;/}", new sap.m.ColumnListItem({
             cells : [
                  new sap.m.Text({
                       text : "{oJSONModel&gt;Name1}"
                  }),
                  new sap.m.Text({
                       text : "{oJSONModel&gt;Werks}"
                  })
             ]
        }));
</code></pre>

<p>How can I show the same data in the table, but only from the JSON model this time?</p>

<p>Any ideas what I'm doing wrong?</p>