cancel
Showing results for 
Search instead for 
Did you mean: 

How to apply filter to the Geo map spot aggregations in a effective way?

Jayakrishnan
Active Participant
0 Kudos
242

HI All,

I am working on custom sapui5 application where i need to maintain table and map in a single page. Table i used is sap.ui.table and map is sap.ui.vbm geomap

My Scenario:

i need to highlight the selected entries in the table in the geomap and vice versa.So i decided to go with same json model to bind for may table and geomap with two way binding enabled. So if user select any item in the ui table, will set the property in the model is true, same property bounded with map spot selection.

As i do not have a option by default in the sap ui table, i added the check box as one column in the sap ui table and bounded with that Boolean property.

Now my scenario changed little more complex:

By default same number of items will be available in the table as well as the map. but once user select any one the rows in the table, that selected item alone need to highlighted in the map. so i defined the below logic in my app, when user click the checkbox, event will be triggered and i apply the filter to the map binding spots. As i disabled the selection mode in the sap ui table, the event selection change also will not work. so that i take the cjheck box event .

Please refer the code below. but it took more time to apply the filter to the spot aggregations in the geomap.

	onNotificationTableSelection: function (evt) {
			debugger
			var filters = [];
			var hasSelected = false;
			var oTableModel = this.getModel("jNotificationModel")
				.getProperty("/jNotificationSet");
			for (var index = 0; index < oTableModel.length; ++index) {
				var oEntity = oTableModel[index];
				if (oEntity.isSelected === true) {
					hasSelected = true;
					break;
				}
			}
			if (hasSelected) {
				filters.push(new Filter("isSelected", sap.ui.model.FilterOperator.EQ, true));
			} else {
				filters = [];
			}
			var oFilterGlobalBusyDialog = new sap.m.BusyDialog();
			oFilterGlobalBusyDialog.open();
         //here it takes more time when i click the checkbox first time
			oView.byId("id_spots_all_collection")
				.getBinding("items")
				.filter(filters);

			oFilterGlobalBusyDialog.close();


		},

Example: If i have 1000 items in the ui table and i select the first, that corresponding spot alone need to visible in the GeoMap. Table will display 1000 items with first one selected. but if the item count increases, it took more time to retrieve the binding items from the Geo map spots and apply filter.

Is there any other way that i can do this?

Thank you,

Regards,

JK.

Accepted Solutions (0)

Answers (0)