cancel
Showing results for 
Search instead for 
Did you mean: 

Smart Table Navigation

Former Member
0 Kudos

I am attempting to get navigation working on a Smart Table using a value which is not bound to the default table columns.

I applied this to the view file:

<ColumnListItem type="Navigation" press="onClientPress">

I am using a Table wrapper within the SmartTable configuration in the view so I can add some custom fields.

Using a regular sap.m.Table, I can call:

onClientPress: function(oEvent) {
this._showClient(oEvent.getSource());
},

_showClient: function(oItem) {
this.getRouter().navTo("client", {
ClientId: oItem.getBindingContext().getProperty("client_id")
});

And it works just fine. However, the same call on a SmartTable does not work, as the property 'client_id' is not bound to the table columns (by default). If I add the field, then the navigation works. We don't want to display this value by default, as it is irrelevant to the end user. However, realizing that with Smart Table personalization, they would be able to add the column if they so choose.

I browsed through the available functions on the SmartTable, but cannot find the method/function I could call to get the property I require for the navigation to work.

Any help would bed appreciated!

Cheers,

Tim

Former Member
0 Kudos

I was able to get this working by using the 'requestAtLeastFields' option on the SmartTable.

requestAtLeastFields="client_id"

Now, the item object on the table row contains the 'client_id', in addition to the other fields which are displayed, thus the navigation works.

Cheers,

Tim

Former Member
0 Kudos

Hi, Tim
Can u please attach project files to observe.

Kind regards,

Artem

Former Member
0 Kudos

Here is the Smart Table Configuration:

	<smartTable:SmartTable 
		id="clientListSmartTable"
		initialise="onSmartTable"
		beforeRebindTable="onBeforeRebindTable"
		entitySet="<yourEntitySet>"
		smartFilterId="<yoursmartFilterBar>" 
		tableType="ResponsiveTable" 
		useExportToExcel="false" 
		useVariantManagement="false" 
		useTablePersonalisation="true"
		persistencyKey="gSmartTable_Explored"
		header="<yourHeader>" 
		showRowCount="true"
		enableAutoBinding="true"
		requestAtLeastFields="client_id">

Hope that helps!

Tim

Accepted Solutions (0)

Answers (0)