Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Tree Grid fields do not respect the provided sort order

    SmartClient Version: v12.0p_2021-08-08/Pro Deployment (built 2021-08-08)
    Chrome Version 99.0.4844.74 (Official Build) (64-bit)

    Hi, I have been trying to add predefined sorts on tree fields. I took the current example at this link 'https://www.smartclient.com/smartclient/showcase/?id=treesSorting' and added a sort on the "Jobs" field. The tree did not get sorted.
    I also tried adding it on the name fields etc. But the tree still did not respect the sort order. Manually clicking on the tree fields did sort the tree and multi-sort also works fine when manually selecting several columns.

    Can you confirm that this is a bug and will get resolved in some future build.

    isc.TreeGrid.create({
    ID: "employeeTree",
    width: 500,
    height: 400,
    dataSource: "employees",
    nodeIcon:"icons/16/person.png",
    folderIcon:"icons/16/person.png",
    showOpenIcons:false,
    showDropIcons:false,
    closedIconSuffix:"",
    autoFetchData:true,
    showSelectedIcons:true,
    autoOpenTree: "all",
    dataProperties:{
    loadDataOnDemand:false
    },
    fields: [
    {name: "Name", sortDirection : 'ascending'},
    {name: "Job"},
    {name: "Salary", formatCellValue: "isc.NumberUtil.format(value, '\u00A4,0.00')"}
    ]
    });
    Last edited by Vivek_Gungabissoon; 21 Mar 2022, 07:51. Reason: Made code easy to read via use of the QUOTE tags

    #2
    See docs - you need to set sortField. All you have specified is the default sort direction for the Job field if the Job field were sorted. You have not specified that the Job field should in fact be sorted.

    Comment

    Working...
    X