Results 1 to 6 of 6

Thread: [FIXED-137] Only 2 events on data Stores?

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Jun 2010
    Posts
    64
    Vote Rating
    1
      0  

    Question [FIXED-137] Only 2 events on data Stores?

    I'm missing a lot of events on the Stores/Proxies/Readers... There is no "load", "beforeload", "save" etc. like in ExtJs 3.2.1.

  2. #2
    Sencha User
    Join Date
    Jun 2010
    Posts
    64
    Vote Rating
    1
      0  

    Default

    *kick*

  3. #3
    Sencha User
    Join Date
    Nov 2007
    Posts
    294
    Vote Rating
    0
      0  

    Default

    Additionally, the 'datachanged' event gets fired twice for a single load.

    Without the 'load' semantics, using stores will be hard.

    Also, there is a bug whereby the url: field is not conveyed when used as a default config value such as:

    Code:
            this.store = new Ext.data.JsonStore({
                // store configs
                autoDestroy: true,
                url: '../jsp/data.jsp',     <---- this does not get set correctly internally and buildUrl() throws an error
                storeId: 'menu',
                // reader configs
                root: 'items',
                idProperty: 'text',
                fields: ['text','card','source']
            });

  4. #4
    Sencha User
    Join Date
    Jun 2010
    Posts
    64
    Vote Rating
    1
      0  

    Default

    @Sesshomurai the way a store works is like this:

    Code:
    booksLibrary = new Ext.data.JsonStore({
    			autoLoad: false,
    			getGroupString: function(record){
    				return record.get('title')[0];
    			},
    			model: 'book',
    			proxy: {
    				url: '/books.json',
    				type: 'ajax',
    				reader: {
    					root: 'books',
    					type: 'json',
    				},
    				writer: {
    					type: 'json',
    				}
    			},
    			storeId: 'books',
    		});
    instead of fields you can use models:

    Code:
    		Ext.regModel('book', {
    			idProperty: 'id',
    			fields: [
    				{name: 'id', type: 'string'},
    				{name: 'title', type: 'string'},
    				{name: 'slug', type: 'string'},
    				{name: 'author', type: 'string'},
    				{name: 'chapters', type: 'object'},
    			],
    		});

  5. #5
    Sencha User
    Join Date
    Nov 2007
    Posts
    294
    Vote Rating
    0
      0  

    Default

    Yeah. I see they have the model pattern too. But the example I posted above came directly from the Touch API for JsonStore. I tried it, and it doesn't work cuz of a bug is all. But otherwise, it works the other way too. Apparently.

  6. #6
    Sencha User edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    11
      0  

    Default

    We've added several additional events to Stores recently, including beforeload, load, add, remove, datachanged and beforesync. Some of these will become available as of the next release. Please leave additional comments if you are missing events that would help you write your applications.
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

Similar Threads

  1. Efficiency of ExtJS data stores and large data sets
    By BlueCamel in forum Community Discussion
    Replies: 14
    Last Post: 17 Jan 2012, 10:17 PM
  2. using Data Stores?
    By Cyberqat in forum Ext Designer: Help & Discussion
    Replies: 2
    Last Post: 11 Jun 2010, 7:24 AM
  3. Replies: 6
    Last Post: 25 Aug 2009, 5:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •