Announcement

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

    12.0p Grouped ListGrid does not display data after client side filterData()

    Hi Isomorphic,

    in my application (v12.0p_2018-12-13) a grouped ListGrid does not redraw it's data and is just empty under certain cases where client side filtering is possible and would lead to less records.
    Unfortunately I could not reproduce in the showcase so far, but this modified sample (v12.0p_2018-12-20) mimics my ListGrid very good. Do you have any idea what might be causing this?

    The order of actions with which it happens in my application would match clicks on "Fetch no criteria", then "filterData unitCost + 2x itemID", then "filterData unitCost + itemID".
    Here the latter two clicks do not result in fetches and the last click would result in no data displayed. An invalidateCache() then displays the correct data in my application.

    Code:
    isc.ListGrid.create({
        ID:"dsListGrid", 
        width: "100%",
        height: "100%",
        autoFetchData: false,
        canEdit: true,
        sortByGroupFirst: true,
        //groupStartOpen: "none",
        canMultiGroup: true,
        groupByField: ["category", "nextShipment"],
        initialSort: [
            {property: "units", direction: "ascending"},
            {property: "SKU", direction: "ascending"}
        ],
        dataSource: "supplyItem",
        showFilterEditor: false,
        implicitCriteria: { _constructor: "AdvancedCriteria", operator: "and",
            criteria: [ { fieldName: "units", operator: "isNull" } ]
        },
        fields:[
            {name:"itemID"},
            {name:"itemName"},
            {name:"SKU"},
            {name:"description"},
            {name:"category", hidden: true, canHide:false,
                getGroupTitle : function (groupValue, groupNode, field, fieldName, grid) {
                    return "Title: " + groupValue;
                }
    },
            {name:"units"},
            {name:"unitCost"},
            {name:"nextShipment", hidden: true, canHide:false,
                getGroupTitle : function (groupValue, groupNode, field, fieldName, grid) {
                    return "Title: " + groupValue;
                }
    }
        ],
    });
    
    isc.IButton.create({
        ID:"fetchButton", width: 200,
        title:"Fetch no criteria",
        click : function () {
            dsListGrid.fetchData();
        }
    });
    
    isc.IButton.create({
        ID:"fetchButton2", width: 200,
        title:"Fetch unitCost",
        click : function () {
            dsListGrid.fetchData({ _constructor: "AdvancedCriteria", operator: "and",
                                         criteria: [ { fieldName: "unitCost", operator: "equals", value: 0 } ]
            });
        }
    });
    
    isc.IButton.create({
        ID:"filterDataButton", width: 200,
        title:"filterData unitCost",
        click : function () {
               dsListGrid.filterData({ _constructor: "AdvancedCriteria", operator: "and",
                                         criteria: [ { fieldName: "unitCost", operator: "equals", value: 0 } ]
            });//, null, { textMatchStyle: "exact" });
        }
    });
    
    isc.IButton.create({
        ID:"filterDataButton2", width: 200,
        title:"filterData unitCost + 2x itemID",
        click : function () {
               dsListGrid.filterData({ _constructor: "AdvancedCriteria", operator: "and",
                                         criteria: [ { fieldName: "unitCost", operator: "equals", value: 0 },
                                                     { fieldName: "itemID", operator: "inSet", value: [3291, 2615]}
                                                   ]
            });//, null, { textMatchStyle: "exact" });
        }
    });
    
    isc.IButton.create({
        ID:"filterDataButton3", width: 200,
        title:"filterData unitCost + itemID",
        click : function () {
               dsListGrid.filterData({ _constructor: "AdvancedCriteria", operator: "and",
                                         criteria: [ { fieldName: "unitCost", operator: "equals", value: 0 },
                                                     { fieldName: "itemID", operator: "inSet", value: [3291]}
                                                   ]
            });//, null, { textMatchStyle: "exact" });
        }
    });
    
    isc.IButton.create({
        ID:"showImplicitCriteria", width: 200,
        title:"Show ImplicitCriteria",
        click : function () {
            isc.say(isc.JSON.encode(dsListGrid.getImplicitCriteria()))
        }
    });
    
    isc.HStack.create({
        ID:"hStack",
        membersMargin:10,
        members:[ fetchButton, fetchButton2, filterDataButton, filterDataButton2, filterDataButton3, showImplicitCriteria]
    });
    
    isc.VLayout.create({
        membersMargin:10,
        width: "100%",
        height: "100%",
        members:[ dsListGrid, hStack]
    });
    Thank you & Best regards
    Blama
    Last edited by Blama; 23 Dec 2018, 09:44. Reason: Adjusted sample

    #2
    FYI: This is reproducible in the application, so I can provide you with Developer Console logs, if this helps.

    Comment


      #3
      In this case the regroup would be expected to be triggered by DataChanged, and in your test case it fires as expected and triggers regrouping.

      It's hard to guess how your application code could break this, but perhaps you've added an event handler or other override which crashes in the middle of the flow that would normally trigger a regroup. Or perhaps you replace the dataset entirely via setData() with a hand-created ResultSet.

      Let us know if you track this to a framework bug where you can provide a test case.

      Comment


        #4
        Hi all,

        this one is a non-issue, see here.

        Best regards
        Blama

        Comment

        Working...
        X