Posted 18 June 2019, 8:54 am EST
Working with a MVC Core 2.2 application and Wijmo 5. On loading the grid I want it sorted on a specific column. Tried various ways of using the sortDescription but can’t find anything that works. Here is what I have.
var summaryGrid = new wijmo.grid.FlexGrid(‘#customerGrid’,
{
isReadOnly: true,
autoGenerateColumns: false,
itemsSource: customerData,
columns: [
{ header: ‘id’, binding: ‘id’ },
{ header: ‘Customer Name’, binding: ‘customerName’, width: 250 },
{ header: ‘Current’, binding: ‘currentBalance’, format: ‘c’, width: 100 },
{ header: ‘1 to 30’, binding: ‘pastdue30’, format: ‘c’, width: 100 },
{ header: ‘31 to 60’, binding: ‘pastdue60’, format: ‘c’, width: 100 },
{ header: ‘61 to 90’, binding: ‘pastdue90’, format: ‘c’, width: 100 },
{ header: ‘91 to 120’, binding: ‘pastdue120’, format: ‘c’, width: 100 },
{ header: ‘Over 121’, binding: ‘pastdueOver’, format: ‘c’, width: 100 },
{ header: ‘Balance Due’, binding: ‘customerBalance’, format: ‘c’, width: 100 },
{ header: ‘Ave Days to Pay’, binding: ‘daysToPay’, format: ‘n’, width: 100 }
],
alternatingRowStep: 1
});
summaryGrid.columns[0].visible = false;
summaryGrid.headersVisibility = wijmo.grid.HeadersVisibility.Column;
summaryGrid.sortDescriptions = new wijmo.collections.SortDescription(“customerBalance”, ‘true’);
Appreciate your help. Ed