View Full Version : Help with class system

9 Apr 2014, 4:11 AM
I have noob question.

How can i define init params and methods for my class.

// class for remote grid, where i want describe init params
Ext.define('MyApp.view.GridRemote', {
extend: 'Ext.grid.Panel',

store: {
pageSize: 5,
autoLoad: false,
remoteSort: true,
autoSync: true


// here i want use this init params
Ext.define('MyApp.view.Responses', {
extend: 'MyApp.view.GridRemote',
alias : 'widget.responses',
initComponent: function () {......

15 Apr 2014, 12:04 AM
As written I would expect MyApp.view.Responses to inherit the store config from MyApp.view.GridRemote. Perhaps you can share a more complete test case at https://fiddle.sencha.com to demonstrate the setup?

16 Apr 2014, 12:12 PM
Thank you!

Some example https://fiddle.sencha.com/#fiddle/55c
Here i want to set all instances property autoLoad, defaults and event load.

In real situation i have 10-15 grids with same parametrs, methods and events (for store, proxy etc). What is right case to do this?

16 Apr 2014, 3:52 PM
You can define a store class to be used by your components and the store definition can have an alias which will allow you to then instantiate the store by config - passing in additional configs as needed per grid instance.

See the example here:


16 Apr 2014, 8:51 PM
Thank you. I understand.

In you example propery flex doesnt apply to instance. How be with this?

17 Apr 2014, 11:01 AM

Columns will be a little different in that you can't define a columns class and apply configs to it per instance like you can with a store. The way you would work with column defaults would be to do something like in the example below within the initComponent function.