Skip to Content
0
Sep 02, 2020 at 05:02 AM

How to change the json model property value ?

192 Views

Hi All,

I am working on Custom SAPUI5 Application development. In my application scenario i need to maintain more than 3000 records(it is the maximum ) in my JSON Model and displaying in my sap.ui.table.

In my case i need to show these 3000 items in my ui table and map (sap.ui.vbm.GeoMap), in a single screen. So user can see the same data in two different representations.

The reason i chose json model is,if user select any one of the table rows the same need to be highlighted in my vbm map control and vice versa. so in my json model i introduces new boolean property called bSelect and enabled my json model for two way binding.

The default multi select option of the ui table will not suite for the scenario so i introduces new column for check box and bounded boolean value from my model. It works perfectly .

I am triggering Select all and Deselect all feature via additional button. When the maximum records is there, (i.e 3000), the delay is happening while changing the property.

This is my button press event code:

onSelectAllNotification: function (evt) {
var bSelectAll = evt.getParameter("selected");
var aNotificationCollection = this.getModel("oNotificationJsonModel").getProperty("/NotificationSet");
for (var iNotification = 0; iNotification < aNotificationCollection.length; iNotification++) 
    {
        aNotificationCollection[iNotification].selected = bSelectAll;
    }
this.getModel("oNotificationJsonModel").refresh();
},

Please help me to optimize more and avoid the delay? or is there any other optimized way to do ? Please suggest me.

Thank you,

Regards,

Jayakrishnan.