Threaded View

    You found a bug! We've classified it as TOUCH-3888 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Aug 2012
    Vote Rating
    lgreenway is on a distinguished road


    Default DataView Error When Updating Store Data on Controller Launch

    Sencha Touch version tested:
    • Sencha Touch 2.1
    Browser versions tested against:
    • Google Chrome 23.0.1271.97 m
    • Playbook 2.0 Webkit
    DOCTYPE tested against:
    • html
    • In a Controller's launch function, when attempting to update a model object instance contained in a store specified in a DataView's config, an error occurs.
    Steps to reproduce the problem:
    • Create a controller
    • Create a store and corresponding model. Specify some static data for the store
    • Create a view which is or includes a DataView component. Specify the store in the DataView's config
    • In the controller's launch function, modify some data in one of the model object instances in the store
    The result that was expected:
    • The model object data is updated
    • The DataView component displays the updated data when painted
    The result that occurs instead:
    • The model object data is updated correctly
    • An error occurs in the Ext.dataview.element.Container updateListItem function when attempting to update the item in the DataView corresponding to the model object
    Test Case:

    See attached test application for running example

    Ext.define('Test.controller.Controller', {
        extend: '',
        launch: function() {
            console.log('Controller launch');
            // Modify a model object instance in the store
            Ext.getStore('Store').first().set('foo', 'baz');

    Debugging already done:
    • It's possible that this is due to the change in the DataView's intialize function where the refresh operation is now deferred until the component is painted, which results in the item not existing when the onStoreUpdate handler is called.
    • Create an initialize event handler for the DataView, and either set the desired store (store must not be specified in the config if done this way since the udpate hook will never fire), or call the DataView's refresh function
    Attached Files

Thread Participants: 2