Hi I have a responsive table with data and I need to sort it using the following two columns
The problem is the model sort is only working with a single property. How to sort the table data by the above order.
This is my view
<m:Table id="podetailstable" items="{ path: '/PODetails' , sorter: { path: 'PoNumber' } }">
<m:columns>
<m:Column>
<m:Text text="{i18n>poDetails_tablecol_PoNumber}"/>
</m:Column>
<m:Column>
<m:Text text="{i18n>poDetails_tablecol_PoLine}"/>
</m:Column>
<m:Column>
<m:Text text="{i18n>poDetails_tablecol_PoItemQty}"/>
</m:Column>
</m:columns>
<m:items>
<m:ColumnListItem>
<m:cells>
<m:Text text="{PoNumber}"/>
<m:Text text="{PoLine}"/>
<m:Text text="{PoItemQty}"/>
</m:cells>
</m:ColumnListItem>
</m:items>
</m:Table>
To sort with 2 columns simply add an array of sorter objects:
The below
sorter: { path: 'PoNumber' }
becomes
sorter: [{
path: 'PoNumber',
descending: false
}, {
path: 'PoLine',
descending: false
}]