0 Replies Latest reply on Jun 10, 2010 12:28 AM by jasenm

    AdvancedDataGrid - Sorting on two or three fields

    jasenm Level 1



      I have asked a related question in the LiveCycle DS forum relating to my issue here (so please excuse my cross posting):



      I have some flat data to build a hiearchical tree using the AdvancedDataGrid, not needing summaries or any other function that ADG/groupingCollection offers.


      My issue  is some fields in the flat data only  have two fields (with the web_Category_Level_1 and web_Category_Level_1) set, so I am not  sure how to sort for two fields and/or three fields in the same  flat data.


      The data schema is:


      CategoryName, web_Category_Level_1, web_Category_Level_2, web_Category_Level_3




                        groupingCollection    =    new GroupingCollection();
                        grouping    =    new Grouping();
                       fields         =     new Array();

                       fields.push(new  GroupingField( "web_Category_Level_1", true ));
                        fields.push(new GroupingField( "web_Category_Level_2", true ));
                        fields.push(new GroupingField( "web_Category_Level_3", true ));//this  field is not always present


                       grouping.fields    =    fields;


                        groupingCollection.grouping    =    grouping;

      Had looked into compare  groupingObjectFunction and groupingCompareFunction but did not have much  luck...and not sure if I can even use those to dynamically sort for only the two fields.


      It had been suggested to use LiveCycle 3.1 (see previous post) allowing me to query the local cache and not using ADG.


      Any suggestions much appreciated.