Announcement

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

    Cannot group by date field multiple times with different group modes

    SmartClient_v101p_2016-03-07_PowerEdition

    REPRO Steps
    ==============
    1. Load test case
    2. Select Configure grouping
    3. Slect Inspection Date -> Year
    4. Add new group, Inspection Date -> Month
    5. Click Apply
    6. Observe that an error appears about Inspection Date being used twice

    Expected Outcome: Should be able to group by Inspection Date - Year, then Inspection Date - Month.

    Code:
    <!DOCTYPE html>
    
    <html>
        <head>
    
            <title></title>
            
            <style>
                .diagInfo {
                    font-size: 14px;
                    font-weight: bold;
                    padding: 5px;
                }
            </style>
            
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_Core.js"></script>
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_Foundation.js"></script>
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_Containers.js"></script>
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_Grids.js"></script>
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_Forms.js"></script>
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_DataBinding.js"></script>
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_Drawing.js"></script>
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_PluginBridges.js"></script> 
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_Charts.js"></script>    
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/skins/EnterpriseBlue/load_skin.js"></script>
         
            <script type="text/javascript" >
                var isomorphicDir="http://localhost:8080/isomorphic/";
                
                // set this to the correct JIRA ticket
                var JIRA_TICKET = "SNT-14435";
                
                // test data
                var data = [
                    {inspectorID:12345, region:"Northeast", inspections:206, observations:913,lastInspectionDate:new Date(2012, 8, 13), index:52.6 },
                    {inspectorID:67890, region:"West", inspections:66, observations:2,lastInspectionDate:new Date(2013, 2,2), index:75.3 },
                    {inspectorID:54321, region:"Northeast", inspections:4, observations:67,lastInspectionDate:new Date(2013,2,3), index:75.3 },
                    {inspectorID:09876, region:"South", inspections:24, observations:0,lastInspectionDate:new Date(2012,8,31), index:52.6 }
                ];
                // datasource for the grid        
                isc.DataSource.create({
                    ID: "ds",
                    cacheData:data,
                    clientOnly: true
                });
                
                // once page loads set some diagnostic information, DO NOT CHANGE
                isc.Page.setEvent("load", function() {
                    document.title = JIRA_TICKET + "   (SmartClient version " + isc.versionNumber + ")";
                    var html = [];
                    html.push("Jira: " + JIRA_TICKET);
                    html.push("SmartClient: " + isc.versionNumber);
                    html.push("Browser: " + navigator.appCodeName + " " + navigator.appName + " " + navigator.appVersion);
                    diagLabel.setContents( html.join("<br>"));
                });
    
            
            </script>
    
        </head>
        
        <body>
            <script>
            
                // ===== DO NOT REMOVE =====
                var diagLabel = isc.Label.create({
                            ID: "diagInfo",
                            width: "100%",
                            styleName: "diagInfo",
                            autoFit: true
                        });
                // ===== DO NOT REMOVE =====
                            
                // basic grid        
                var grid = isc.ListGrid.create({
                    dataSource: ds,
                    dataFetchMode : "local",
                    fields: [
                        //{name:"inspectorID", title:"Inspector ID", type:"integer", canReorder: //false }, 
                        {name:"inspections", type:"integer", title:"Number of Inspections Total"},
                        {name:"observations", title:"# Observations"},
                        {name:"region", type:"text", title:"Region/Country"},
                        {name:"lastInspectionDate", type:"date", title:"Last Inspection"}
                    ],
                    autoFetchData: true,
                    clientOnly: true,
                    position: "relative",
                    width : "100%",
                    align : "center",
                    autoFitData : "vertical",
                    autoFitMaxHeight : 400,
                    alternateRecordStyles : true,
                    canAddFormulaFields : true,
                    canAddSummaryFields : true,
                    canGroupBy : true,
                    canReorderFields : true,
                    showGroupSummary : true,
                    canMultiGroup : true,
                    useAdvancedFieldPicker: true,
                    advancedFieldPickerThreshold: 5,
                    autoDraw: false,
                    badFormulaResultValue: "NA"
                });    
                
                
        
                // the main page layout - place all other components afetr diagLabel
                var layout = isc.VLayout.create({
                    width:"100%",
                    membersMargin: 20,
                    members: [
                        // ===== DO NOT REMOVE diagLabel
                        diagLabel,
                        // ===== place anty components here
                        grid
                    ]
                });
                
                    
            </script>
    
        </body>
    
    </html>

    #2
    Grouping on the same field multiple times is not currently supported - it may be something we could add for you via the Feature Sponsorship program, but such a feature would be for a future release - it could likely not be ported back to older releases.

    Comment

    Working...
    X