Announcement

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

    listgrid groupby problems

    I have an invalidateCache/fetch logic that only works if the listgrid does not have grouping. If you run the testcase below using sample data in /isomorphic/system/reference/SmartClient_Explorer.html#dynamicGrouping, click on "test invalidate". You'll notice that the data is not fetched. I see this code working when one of two things is removed:

    1. if I remove groupByField: "continent"
    OR 2. if I remove isA.Tree(countryList.data) check

    What's wrong here? Am I not allowed to call this function for grouped data?

    Code:
    isc.ListGrid.create({
        ID: "countryList",
        width:522, height:224,
        alternateRecordStyles:true, cellHeight:22,
        dataSource: countryDS,groupByField: "continent",
        // display a subset of fields from the datasource
        fields:[
            {name:"countryName"},
            {name:"government"},
            {name:"continent"},
            {name:"countryCode", title:"Flag", width:40, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png", canEdit:false}
        ],
        groupStartOpen:"all"
    
    })
    
    
    isc.Button.create({
    title:"test invalidate",
    left: 700,
    click:function(){
    
    if(countryList.data && isA.ResultSet(countryList.data) || isA.Tree(countryList.data)){
      countryList.invalidateCache();
    
    }else{
      countryList.fetchData();
    
    }
    }
    });

    #2
    I'm using SmartClient Version: v8.2p_2013-03-04/PowerEdition Development Only (built 2013-03-04)

    Comment


      #3
      You haven't said what you're hoping this logic will do, but, when grouped, grid.data becomes a Tree. So your logic ends up calling invalidateCache() on a grid that has never fetched, hence has no cache, and nothing happens.

      Comment


        #4
        Yes, sorry I see what you mean. It makes no sense. Thanks

        Comment

        Working...
        X