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

    AdvancedDataGrid - Sorting on two or three fields

    jasenm Level 1

      Hi

       

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

       

      http://forums.adobe.com/message/2881120#2881120




      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;
                     
                        groupingCollection.refresh(true);


      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.

       

      Cheers

      jasevnm