PDA

View Full Version : store xtype



agentyikes
14 Mar 2011, 3:22 PM
Is this correct?


var store = {
xtype: 'store',
autoLoad: true
proxy: ......
}

Riaz
14 Mar 2011, 4:24 PM
Logically, it looks ok to me but I did not test yet.

agentyikes
14 Mar 2011, 4:43 PM
I tried it but it said xtype:'store' not defined!

crysfel
14 Mar 2011, 5:21 PM
I'm not sure, but I think you can't create a store with a xtype :-/ there's no xtype in the documentation, also I looked at the code and I didn't find the line where the Store class define their xtype.

Best regards

ngardner
15 Mar 2011, 8:38 AM
I'm not sure, but I think you can't create a store with a xtype :-/ there's no xtype in the documentation, also I looked at the code and I didn't find the line where the Store class define their xtype.

Best regards


Correct, there is no store xtype. What your prob looking for is...


var myStore = new Ext.data.Store({
autoLoad: true,
proxy: ......
});

Riaz
15 Mar 2011, 6:30 PM
In the API, I have got following information -

xtype Class
------------- ------------------
button Ext.Button
component Ext.Component
container Ext.Container
dataview Ext.DataView
panel Ext.Panel
slider Ext.form.Slider
toolbar Ext.Toolbar
spacer Ext.Spacer
tabpanel Ext.TabPanel

Form components
---------------------------------------
formpanel Ext.form.FormPanel
checkboxfield Ext.form.Checkbox
selectfield Ext.form.Select
field Ext.form.Field
fieldset Ext.form.FieldSet
hiddenfield Ext.form.Hidden
numberfield Ext.form.Number
radiofield Ext.form.Radio
textareafield Ext.form.TextArea
textfield Ext.form.Text
togglefield Ext.form.Toggle


However, according to the theory, it is mentioned that -
Two ways we can generate a component.
a. Instantiating an Object
b. Passing a child to a container as JSON with an xtype.



Example of Object:



Var myButton = new Ext.Button({
Text:’Activate’
});

Var myPanel = new Ext.Panel({
items:[myButton, …]
});

myButton.on(‘press’,…);





Example of xtype:


Var myPanel = new Ext.Panel({
items:[{
xtype:’button’,
id:’myButton’,
text:’Activate’
}, …]
});

Ext.getCmp(‘myButton’).on(‘press’, …);


is "Store" component?

Juanito
6 Sep 2013, 2:20 PM
I think you just use type intead of xtype, like layout configs


{
type: 'array',
fields: [...],
data: []
}

https://fiddle.sencha.com/#fiddle/fb