-
30 Jun 2010 4:37 PM #1
[FIXED-137] Only 2 events on data Stores?
[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.
-
7 Jul 2010 1:18 PM #2
-
7 Jul 2010 2:35 PM #3
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'] });
-
7 Jul 2010 11:17 PM #4
@Sesshomurai the way a store works is like this:
instead of fields you can use models: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', });
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'}, ], });
-
8 Jul 2010 3:14 AM #5
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.
-
15 Sep 2010 8:52 PM #6Sencha - Community Support Team
- Join Date
- Jan 2009
- Location
- Palo Alto, California
- Posts
- 1,941
- Vote Rating
- 6
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
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
Efficiency of ExtJS data stores and large data sets
By BlueCamel in forum Community DiscussionReplies: 14Last Post: 17 Jan 2012, 10:17 PM -
using Data Stores?
By Cyberqat in forum Ext Designer: Help & DiscussionReplies: 2Last Post: 11 Jun 2010, 7:24 AM -
[FIXED-137][3.0.0] Menu with enableScrolling:false doesn't respect constraints
By elishnevsky in forum Ext 3.x: BugsReplies: 6Last Post: 25 Aug 2009, 5:33 AM


Reply With Quote