Skip to content

Instantly share code, notes, and snippets.

@pphetra
pphetra / gist:5877154
Last active December 19, 2015 01:38
car model & store
Ext.define('Car', {
extend: 'Ext.data.Model',
fields: [
'id',
'brand',
'model',
{name: 'price', type: 'float'}
]
});
f1 = Ext.create('Ext.window.Window', {
title: 'Employee Form',
height: 200,
width: 300,
bodyPadding: 10,
items: [
{
xtype: 'form',
url: '/sagi/service/employees',
defaultType: 'textfield',
Ext.create('Ext.form.Panel', {
title: 'Simple Form with FieldSets',
labelWidth: 75, // label settings here cascade unless overridden
url: 'save-form.php',
frame: true,
bodyStyle: 'padding:5px 5px 0',
width: 550,
renderTo: Ext.get('fs'),
layout: 'column', // arrange fieldsets side by side
defaults: {
Ext.create('Ext.form.Panel', {
title : 'Order Form',
width : 300,
bodyPadding: 10,
renderTo : Ext.get('rdg'),
items: [
{
xtype : 'fieldcontainer',
fieldLabel : 'Size',
defaultType: 'radiofield',
Ext.create('Ext.form.Panel', {
title: 'Checkbox Group',
width: 300,
height: 125,
bodyPadding: 10,
renderTo: Ext.get('cbg'),
items: [{
xtype: 'checkboxgroup',
fieldLabel: 'Two Columns',
// Arrange checkboxes into two columns, distributed vertically
mywin = Ext.create('Ext.window.Window', {
title: 'Hello',
height: 400,
width: 400,
layout: {
type: 'table',
columns: 3
},
items: [
{
Ext.define('Counter', {
count: 0,
constructor: function(num) {
this.count = num;
},
inc: function() {
this.count++;
}
});
store = Ext.create('Ext.data.Store', {
fields: [
'id',
'model',
'brand'
],
proxy: {
type: 'ajax',
url: '/sagi/service/car',
batchActions: false,
store = Ext.create('Ext.data.Store', {
fields: [
'id',
'model',
'brand'
],
proxy: {
type: 'ajax',
url: '/sagi/service/car',
reader: {
var arrayData = [
['Camry', 'Toyota'],
['Yaris', 'Toyota'],
['Jazz', 'Honda'],
['Freed', 'Honda'],
['March', 'Nissan']
]
Ext.define('Car', {
extend: 'Ext.data.Model',