jeudi 29 mai 2014

[5.0.0] GridPanels with Bound Chained Stores Have Views Drawn Twice



  1. Thank you for reporting this bug. We will make it our priority to review this report.







  2. Default [5.0.0] GridPanels with Bound Chained Stores Have Views Drawn Twice



    [5.0.0] GridPanels with Bound Chained Stores Have Views Drawn Twice





    Ext version tested:

    Browser versions tested against:




    Description:

    • Chained stores in a ViewModel that are bound to a GridPanel cause the GridPanel's View to be drawn twice. If the binding is replaced with a direct reference to the parent's storeId, the grid panel is only drawn once




    Steps to reproduce the problem:

    • See fiddle attached below




    The result that was expected:

    • GridPanel's View should be drawn once




    The attached fiddle shows two grids, one with a bound store, the other one with an explicit store configuration. The "refresh" event on the grids writes the following to the console.

    [Log] Bound Store Updated (fiddle.sencha.com, line 61)

    [Log] Bound Store Updated (fiddle.sencha.com, line 61)

    [Log] Configured Store Updated (fiddle.sencha.com, line 61)


    See the following Fiddle:














  3. Default







    It's fairly difficult to call this a bug. The view model notifications run asynchronously, so the first time the view refreshes it has the empty store attached to it. Once the VM fires, the chained store gets bound (after render) to the parent store.

    You would get the same behaviour had you not configured the grid with a store. The difficulty is that you don't know when the bind will show up.








    Evan Trimboli

    Sencha Developer

    Twitter - @evantrimboli

    Don't be afraid of the source code!












  4. Default







    That's what I thought at first...

    So I added a column renderer to output the firstName field on every pass. It appears that the data is already available in the chained store the first time the view refreshes.


    I've updated the fiddle to reflect this.


    Here's my output:


    [Log] Jimmy (fiddle.sencha.com, line 67)

    [Log] Robert (fiddle.sencha.com, line 67)

    [Log] John Paul (fiddle.sencha.com, line 67)

    [Log] John (fiddle.sencha.com, line 67)

    [Log] Bound Store Updated (fiddle.sencha.com, line 61)

    [Log] Jimmy (fiddle.sencha.com, line 67)

    [Log] Robert (fiddle.sencha.com, line 67)

    [Log] John Paul (fiddle.sencha.com, line 67)

    [Log] John (fiddle.sencha.com, line 67)

    [Log] Bound Store Updated (fiddle.sencha.com, line 61)

    [Log] Jimmy (fiddle.sencha.com, line 67)

    [Log] Robert (fiddle.sencha.com, line 67)

    [Log] John Paul (fiddle.sencha.com, line 67)

    [Log] John (fiddle.sencha.com, line 67)

    [Log] Configured Store Updated (fiddle.sencha.com, line 61)














Aucun commentaire:

Enregistrer un commentaire