STAND-ALONE TEST CASE

Fiddle: http://ift.tt/12ZHhLg

ADDITIONAL INFO

Ext version tested:


Browser versions tested against: DOCTYPE tested against: Description:

  • If the groupingsummary feature is active and the "sortOnLoad" property is set to false on the corresponding store, then editing values in a grid can butcher the ordering and grouping of rows.


Steps to reproduce the problem:

  • Make a store with groupable data, a groupField, and "sortOnLoad" set to false

  • Make a grid with the store attached and the groupingsummary feature active

  • Edit some non-groupField record value within the store (e.g., via a cellediting plugin or by capturing the model and calling its "set" method)


The result that was expected:

  • Row corresponding to record should change to show the altered value, but grouping should not change


The result that occurs instead:

  • Rows render out of order and out of their groups.


Issue is caused by Ext.util.Collection#itemChanged attempting to sort. If it determines that the items are out of order, it appears to sort the changed item by adding/removing it.

The specific issue that I'm experiencing in my environment is that, when it finally tries to build the grid view DOM from templates, the record hasn't actually been added to the store yet so "recordIndex" is -1, which leads to "rowValues.isFirstRow" being evaluated as false for the record and therefore no group header being built for the row. The majority of this is evaluated in Ext.view.Table#renderRow and the various templates.


WORKAROUND



  • Set "sortOnLoad" to true (or leave true, as default)


FIDDLE