Announcement

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

    GroupState fires changes when setting data

    Hey guys,

    found a bug when working with the “groupStateChanged” event.

    I built a listGrid which includes a groupByField. Afterwards I put some data into the listgrid via listgrid.setData(). When doing so, the event “groupStateChanged” will fire. This event shouldn’t fire when setting data, because the groupState can’t be different afterwards.

    Following a small example including the issue

    Code:
    isc.ListGrid.create({
    	"ID" : "listGrid",
    	"groupStateChanged" : function () {
    		isc.say("groupStateChanged fired<br>Is the new groupState the same like initially?<br>" + (viewStateBefore == listGrid.getGroupState()))
    	},
    	"fields" :
    	[{
    			"name" : "name"
    		}
    	],
    	"groupByField" : "name"
    });
    var viewStateBefore = listGrid.getGroupState();
    listGrid.setData([{
    			"name" : "One"
    		}, {
    			"name" : "Two"
    		}
    	])
    This is reproducable with the latest nightly SmartClient_v100p_2015-02-20_Pro and happens in all current browsers (Firefox, Chrome and IE)

    Best Regards

    #2
    Hey guys,

    are there any news about this?
    Do you need more information about the described behavior?

    Thanks for your response.

    Best Regards

    Comment


      #3
      Is is true that groupStateChanged fires in this case when it isn't actually necessary.
      We'll see if we can make a framework change to avoid this unnecessary call.

      In the meantime we think this shouldn't produce any application level bugs.
      The notification may fire in cases when the group state is actually unchanged but while this may run some app logic more frequently than required, it seems unlikely this will produce any user-impact.
      However it should also be straightforward to work around this at the app level by performing a comparison in your handler.


      Regards
      Isomorphic Software

      Comment


        #4
        Just a quick follow up to note that we've fixed the framework to avoid this unnecessary call. This change will be present in the 10.0p and 10.1d branch in nightly builds going forward (March 7 and above)

        Regards
        Isomorphic Software

        Comment

        Working...
        X