Hi, continuing to evaluate the new sortByGroupFirst feature and see another issue.
Load this example:
http://www.smartclient.com/#customColumns
Use the code below that sorts by population descending and turns on sortByGroupFirst with groupSortDirection of 'ascending'
Steps
1. Show Formula Builder
2. Add formula: record.continent=='Asia'?2:1 and save
3. Group by new Formula column
4. The grid should sort by the new grouped formula column in ascending order. But it doesn't and shows the 2 group first.
Load this example:
http://www.smartclient.com/#customColumns
Use the code below that sorts by population descending and turns on sortByGroupFirst with groupSortDirection of 'ascending'
Steps
1. Show Formula Builder
2. Add formula: record.continent=='Asia'?2:1 and save
3. Group by new Formula column
4. The grid should sort by the new grouped formula column in ascending order. But it doesn't and shows the 2 group first.
Code:
var ds = isc.DataSource.get("countryDS"); isc.VLayout.create({ ID:"layout", width:500, height:250, members: [ isc.HLayout.create({ ID:"buttonLayout", width:"*", height:30, membersMargin: 10, members: [ isc.IButton.create({ ID: "formulaButton", autoFit: true, title: "Show Formula Builder", click: "countryList.addFormulaField();" }), isc.IButton.create({ ID: "summaryButton", autoFit: true, title: "Show Summary Builder", click: "countryList.addSummaryField();" }), isc.IButton.create({ ID: "stateButton", autoFit: true, title: "Recreate from State", click: function () { var state = countryList.getFieldState(); countryList.destroy(); recreateListGrid(); countryList.setFieldState(state); } }) ] }) ] }); recreateListGrid(); function recreateListGrid() { var grid = isc.ListGrid.create({ ID: "countryList", width:"100%", height:"*", alternateRecordStyles:true, cellHeight:22, dataSource: ds, sortByGroupFirst:true, groupSortDirection:'ascending', autoFetchData: true, canAddFormulaFields: true, canAddSummaryFields: true, fields:[ {name:"countryCode", title:"Flag", width:50, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png" }, {name:"countryName", title:"Country"}, {name:"capital", title:"Capital"}, {name:"population", title:"Population"}, {name:"area", title:"Area (km²)"}, {name:"gdp", format: ",0"} ] }); var sort = {property:'population',direction:Array.DESCENDING }; var sortList=[]; sortList.push(sort); countryList.setSort(sortList); layout.addMember(grid); }
Comment