cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hi,

I need to be able to create an table dynamically, making the request with $select dynamic and binding the smarttable to only show the fields that were selected. I tried to assign the fields on the select this way "this.getView().byId(sTableId).getBinding().mParameters.select = " on beforeRebindTable and then all others fields make them invisible but i don't think thats a right way to do that.
I wanted the table to render only the fields passed on the select, so when changing for example the fields control, the other's fields from my entity doesn't show

Code examples would be great,

thank you!

0 Likes
View Entire Topic
junwu
SAP Champion
SAP Champion
0 Likes

do you really have this kind of business scenario, that you changed the field property and want it to be reflected immediately?

check if recreating smart table will help.

const smartTable = new sap.ui.comp.smarttable.SmartTable(
('smartTable-id'),
{
entitySet: 'yourEntity',
width: '100%',
enableAutoBinding: true,
tableType: 'ResponsiveTable',
useExportToExcel: false,
showFullScreenButton: true,
useTablePersonalisation: false
}
);
0 Likes

Hi Jun,

Depreciation area * are the fields that were dynamically changed their name and don't modify their visibility.
in the case of change of fields in the view settings, the fields that i make them invisible in the controller "NetbookValue*" are shown as well due to assign them initial fields on the view. Even modifying the $select request on beforeRebind event, that unwanted fields come in. So at each new request of data ( GO button ) I wanted to build the table ( so unwanted fields will not shown ), or adding/removing the dynamic columns someway and ofcourse in a new request of data i would need to reset or delete the table.

In the case of building the table would be on onGo event? and how I would remove the "old" table to then create a new one?
I'm quite new to sapui5, so in that case I would remove my xml view, and making the view and table in the controller right? But how can I do that? Ok i understand the part to create the table etc ( at what event it will trigger that ?), but i don't understand how i can show that table on the page. Code examples would help a lot.

junwu
SAP Champion
SAP Champion
0 Likes

still not able to understand your scenario....