cancel
Showing results for 
Search instead for 
Did you mean: 

Is TableSelectDialog Column Sortable?

Jayakrishnan
Active Participant
0 Kudos

Hi All,

I am working on a Custom SAPUI5 application development. In my application scenario, i need to use the TableSelectDialog control in a button click. Inside the TableSelectDialog column, i need to apply the sorting on each column. Is it possible?

Please help me to identify the solution for this.

Thank you,

Regards,

JK.

Accepted Solutions (0)

Answers (5)

Answers (5)

WouterLemaire
Active Contributor
0 Kudos

Hi Jayakrishnan,

Sorting by clicking on a specific column isnot possible in the Table Select Dialog. Instead, you could create a custom Dialog with a searchfield and the sap.ui.table to have the sorting feature. Somewhat like this, but in a dialog:

https://ui5.sap.com/#/entity/sap.m.SearchField/sample/sap.m.sample.ListSelectionSearch

Another possibility would be to use the View Settings Dialog in combination with your custom Dialog:

https://ui5.sap.com/#/entity/sap.m.ViewSettingsDialog/sample/sap.m.sample.ViewSettingsDialog

Kr, Wouter

Jayakrishnan
Active Participant
0 Kudos

Hi c3d1947136cd4c748a7aa794001af496 , Thanks for your inputs. I will try that.

tswami67
Explorer
0 Kudos

Hi expert, gd evening! my requirement is also almost same. My user wanted to sort by any fields by themselves when open table in dialog fragment .Can anyone help for me as am very new in ui5. Thanks in advance.

best regards

Swami

Jayakrishnan
Active Participant
0 Kudos

Thank you s.kancherla and sharma.chetanya for your comments. The code you have mentioned above will sort by default, but i need to click the specific column and and apply sort ascending/descending ? i sit possible in Table Select Dialog? as we do this in sap.ui.table and responsive table.

Thank you,

Regards,

Jayakrishnan.C

s_kancherla
Participant
0 Kudos

hi,

Yes it is possible.

As mentioed by Sharma Chetanya you can use the sort property, a small change in regard to your question to sort multipply columns.

The sort property for item binding can also be a array and you can mention all the coulumns you want the sort, they will be sorted in the order as mentioned in the array.

items="{
	 path : '/ProductCollection',
	 sorter : [{
		path : 'Name',
		descending : false
	   }, {
		path : 'ProductName',
		descending : true
	   }]
	}"

first Name is sorted -> Ascending order

and then ProductName -> Descending order

regards

Sudhir

former_member190655
Participant
0 Kudos
former_member190655
Participant
0 Kudos
Standard sorting would help, as this control does have items aggregation

<TableSelectDialog
 title="My Product"
 confirm="handleClose"
 cancel="handleClose"
 items="{
	 path : '/ProductCollection',
	 sorter : {
		path : 'Name',
		descending : false
	   }
	}">
	<ColumnListItem>
	 <cells>
	  <ObjectIdentifier title="{Name}" text="{ProductId}" />
          ..
         </cells>
        </ColumnListItem>

</TableSelectDialog>