cancel
Showing results for 
Search instead for 
Did you mean: 

"Cannot read property 'openDialog' of undefined" upon opening personalisation dialog in Smart Table

former_member626660
Participant

Hi ,

I have used a Smart Table of type "Table" and used an sap.ui.table inside my smart control. I have set the property showTablePersonalisation as "true" to enable the personalisation dialog. But when i click on the settings button in my table it throws this error " Uncaught TypeError: Cannot read property 'openDialog' of undefined".

Any ideas on how to solve this issue will be highly appreciated, thanks!!

Regards

Imtiaz N

former_member524141
Participant

Please post your code for smart table. There is certinly some issue there.

former_member626660
Participant
0 Kudos

Hi Ravi, I've used the smart table inside an xml fragment, please find the code below

<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core" xmlns:smartTable="sap.ui.comp.smarttable" xmlns:layout="sap.ui.layout" xmlns:ui="sap.ui.table">
<smartTable:SmartTable id="sST-RefStore" smartFilterId="sFB-RefStore" 
useExportToExcel="false" 
entitySet="EntitySetA" 
tableType="Table" 
useVariantManagement="false" 
useTablePersonalisation="true" 
showTablePersonalisation="true" 
persistencyKey="pkRef" 
showRowCount="true" 
enableAutoBinding="false" 
beforeRebindTable="checkRebindRS" 
requestAtLeastFields="Store,City,Description">
   <smartTable:customToolbar>
	<OverflowToolbar design="Transparent">
	<ToolbarSpacer/>
	<OverflowToolbarButton icon="sap-icon://add" text="{i18n>addBtn}" press="onAddRS"/>
	</OverflowToolbar>
    </smartTable:customToolbar>
<ui:Table id="rsTable" rows="{EntitySetA}" rowActionCount="1" 
    selectionMode="Single" rowSelectionChange="onRSItemPress" fixedColumnCount="3">
	<ui:columns>
	    <ui:Column sortProperty="Store" filterProperty="Store" defaultFilterOperator="Contains" tooltip="{/#EntityA/Store/@sap:label}" width="5rem">
	    <Label text="{/#EntityA/Store/@sap:label}" wrapping="true"/>
		<ui:template>
		<Text text="{Store}" wrapping="true"/>
		</ui:template>
	</ui:Column>
	<ui:Column sortProperty="City" filterProperty="Subindex" tooltip="{/#EntityA/City/@sap:label}" width="5rem">
	     <Label text="{/#EntityA/City/@sap:label}" wrapping="true"/>
		<ui:template>
		<Text text="{City}" wrapping="true"/>
		</ui:template>
	</ui:Column>
	<ui:Column sortProperty="Description" sortOrder="Descending" filterProperty="Description" tooltip="{/#EntityA/Description/@sap:label}" width="5rem">
	<Label text="{/#EntityA/Description/@sap:label}" wrapping="true"/>
	   <ui:template>
	   <Text text="{Description}" wrapping="true"/>
	   </ui:template>
	</ui:Column>
</ui:columns>
	<ui:rowActionTemplate>
	      <ui:RowAction>
	      <ui:items>
	      <ui:RowActionItem type="Navigation" press="onRSNavPress"/>
	      </ui:items>
	      </ui:RowAction>
	</ui:rowActionTemplate>
</ui:Table>
	<!--layout data used to make the table growing but the filter bar fixed -->
		<smartTable:layoutData>
			<FlexItemData growFactor="1" baseSize="0%"/>
		</smartTable:layoutData>
	</smartTable:SmartTable>
</core:FragmentDefinition>
View Entire Topic
former_member524141
Participant

Try using below code, referenced from here .

Custom data key for each custom is required field and its value should be p13nData only.

<columns>
<Column id="SalesOrder" hAlign="Begin" >
<customData>
<core:CustomData key="p13nData" value='\{"columnKey": "SalesOrder","columnIndex":"2"}'/>
</customData>
<Text text="SalesOrder"/>
</Column>
</columns>



<items>
<ColumnListItem>
<cells>
<!-- text or input field as per your requirement. --> 
</cells>
</ColumnListItem>
</items>
former_member626660
Participant
0 Kudos

Thanks for the suggestion Ravi Verma.. 🙂 your suggested method worked.. thanks a lot.. 🙂