gigofizz
11 Jan 2012, 12:31 PM
Picture 1: 30627
Problem in recovering the value of the combo [Marca "Brands", Rubro "Categories", Estado "Status" (boolean)]
VIEW:
---------
/ Products / edit.js :
{ xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
xtype: 'combo',
name: 'mar_nombre',
fieldLabel: 'MARCA',
store: 'ListBrands',
mode: 'local',
valueField: 'mar_codigo',
displayField: 'mar_nombre',
flex: 1,
labelWidth: 70,
forceSelection : true,
editable : false,
allowBlank: false
},{
xtype: 'combo',
name: 'cat_codigo',
fieldLabel: 'RUBRO',
margins: '0 0 0 6',
store: 'ListCategories',
mode: 'local',
valueField: 'cat_codigo',
displayField: 'cat_nombre',
flex: 1,
labelWidth: 35,
forceSelection : true,
editable : false,
allowBlank: false
}]
},{
xtype: 'fieldset',
title: this.locale.module.products.form.tit2,
layout: 'anchor',
defaults: {
anchor: '100%',
labelStyle: 'padding-left:4px;'
},
items: [{
xtype: 'combo',
name: 'pro_estado',
fieldLabel: 'ESTADO',
labelWidth: 70,
allowBlank: false,
forceSelection: true,
editable : false,
store: 'StatusStore',
queryMode: 'local',
displayField: 'name',
valueField: 'idst',
renderTo: Ext.getBody()
}]
}
/ Products / Grid.js :
{//GRID- RUBRO header: 'Categoria',
dataIndex: 'cat_nombre',
sortable: true,
flex: 1
},{//GRID-STATUS
xtype: 'booleancolumn',
header: 'Estado',
dataIndex: 'pro_estado',
sortable: true,
flex: 1,
falseText: 'Inactivo',
trueText: 'Activo'
}
STORE:
-----------
StatusStore.js
-----------------
//COMBO STATUS
Ext.define('SG.crm.store.StatusStore', { extend: 'Ext.data.Store',
autoLoad: true,
storeId: 'StatusStore',
fields: ['idst', 'name'],
data : [
{"idst":'0', "name":'Inactivo'},
{"idst":'1', "name":'Activo'}
]
});
ListBrands.js
----------------
//COMBO MARCA/BRANDS
Ext.define('SG.crm.store.ListBrands', { extend: 'Ext.data.Store',
storeId: 'ListBrands',
model: 'SG.crm.model.ListBrand',
proxy: {
type: 'rest',
url: '/rest/crm/brands/'
},
autoLoad: true
});
MODEL:
-----------
ListBrand.js
---------------
Ext.define('SG.crm.model.ListBrand', {
extend: 'Ext.data.Model',
idProperty: 'mar_codigo',
fields: [{
name: 'mar_codigo'
},{
name: 'mar_nombre',
type: 'string'
},{
name: 'mar_descripcion',
type: 'string'
},{
name: 'mar_estado'
}],
proxy: {
type: 'rest',
batchActions: false,
url : '/rest/crm/brands/',
reader: {
type: 'json',
root: 'rows',
totalProperty: 'total'
}
}
});
CONTROLLER:
----------------------
stores: ['Products','ListBrands','ListCategories'],
models: ['Product','ListBrand','ListCategorie'],
I can help solve this problem.
Thanks you for your help.
Problem in recovering the value of the combo [Marca "Brands", Rubro "Categories", Estado "Status" (boolean)]
VIEW:
---------
/ Products / edit.js :
{ xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
xtype: 'combo',
name: 'mar_nombre',
fieldLabel: 'MARCA',
store: 'ListBrands',
mode: 'local',
valueField: 'mar_codigo',
displayField: 'mar_nombre',
flex: 1,
labelWidth: 70,
forceSelection : true,
editable : false,
allowBlank: false
},{
xtype: 'combo',
name: 'cat_codigo',
fieldLabel: 'RUBRO',
margins: '0 0 0 6',
store: 'ListCategories',
mode: 'local',
valueField: 'cat_codigo',
displayField: 'cat_nombre',
flex: 1,
labelWidth: 35,
forceSelection : true,
editable : false,
allowBlank: false
}]
},{
xtype: 'fieldset',
title: this.locale.module.products.form.tit2,
layout: 'anchor',
defaults: {
anchor: '100%',
labelStyle: 'padding-left:4px;'
},
items: [{
xtype: 'combo',
name: 'pro_estado',
fieldLabel: 'ESTADO',
labelWidth: 70,
allowBlank: false,
forceSelection: true,
editable : false,
store: 'StatusStore',
queryMode: 'local',
displayField: 'name',
valueField: 'idst',
renderTo: Ext.getBody()
}]
}
/ Products / Grid.js :
{//GRID- RUBRO header: 'Categoria',
dataIndex: 'cat_nombre',
sortable: true,
flex: 1
},{//GRID-STATUS
xtype: 'booleancolumn',
header: 'Estado',
dataIndex: 'pro_estado',
sortable: true,
flex: 1,
falseText: 'Inactivo',
trueText: 'Activo'
}
STORE:
-----------
StatusStore.js
-----------------
//COMBO STATUS
Ext.define('SG.crm.store.StatusStore', { extend: 'Ext.data.Store',
autoLoad: true,
storeId: 'StatusStore',
fields: ['idst', 'name'],
data : [
{"idst":'0', "name":'Inactivo'},
{"idst":'1', "name":'Activo'}
]
});
ListBrands.js
----------------
//COMBO MARCA/BRANDS
Ext.define('SG.crm.store.ListBrands', { extend: 'Ext.data.Store',
storeId: 'ListBrands',
model: 'SG.crm.model.ListBrand',
proxy: {
type: 'rest',
url: '/rest/crm/brands/'
},
autoLoad: true
});
MODEL:
-----------
ListBrand.js
---------------
Ext.define('SG.crm.model.ListBrand', {
extend: 'Ext.data.Model',
idProperty: 'mar_codigo',
fields: [{
name: 'mar_codigo'
},{
name: 'mar_nombre',
type: 'string'
},{
name: 'mar_descripcion',
type: 'string'
},{
name: 'mar_estado'
}],
proxy: {
type: 'rest',
batchActions: false,
url : '/rest/crm/brands/',
reader: {
type: 'json',
root: 'rows',
totalProperty: 'total'
}
}
});
CONTROLLER:
----------------------
stores: ['Products','ListBrands','ListCategories'],
models: ['Product','ListBrand','ListCategorie'],
I can help solve this problem.
Thanks you for your help.