PDA

View Full Version : combobox background transparent / opacity



afidalgo
28 Jan 2014, 6:25 PM
Hello, im filling a combobox from the controller this way


Ext.define('modelCodigo', {
extend: 'Ext.data.Model',
fields: [
{name: 'categoria', type: 'int'},
{name: 'codigo', type: 'int'},
{name: 'descripcion', type: 'string'},
{name: 'habilitado', type: 'boolean'},
{name: 'linea', type: 'string'},
{name: 'marca', type: 'string'},
{name: 'precio', type: 'float'},
{name: 'tipo', type: 'string'}
]
});
var storeCodigo = Ext.create('Ext.data.Store', {
model: 'modelCodigo',
autoLoad: true,
sorters: {property: 'codigo', direction: 'ASC'},
proxy: {
type: 'ajax',
url: 'resources/php/productos.php',
extraParams: {
marca: marca,
categoria: selectionID
},
reader: {
type: 'json',
root: 'productos'
}
}
});
Ext.ComponentQuery.query("Item form combobox[name=codigo]")[0].bindStore(storeCodigo);

store is created and combo is filled as expected, problem is, when i try to select a value from the combobox, background is transparent.

i tried to insert image here with no success, neither as attach.

image is on

http://www.facilcompras.com.ar/combo1.png

thanks in advance

palakurthivishal
29 Jan 2014, 2:41 AM
Hello afidalgo,
Can you paste the config of your combo?

afidalgo
29 Jan 2014, 4:02 AM
sure, this is the controller


verCatalogo: function(item)
{
var menu = Ext.ComponentQuery.query("myMenu treeview")[0];
if (menu.getSelectionModel().selected.length === 1)
{
var selectionID = menu.getSelectionModel().selected.items[0].raw.id;
var selectionText = menu.getSelectionModel().selected.items[0].raw.text;
var marca = item.raw.id;


var itemWindow = Ext.widget("Item");
//armo el store del combo de productos
Ext.define('modelCodigo', {
extend: 'Ext.data.Model',
fields: [
{name: 'categoria', type: 'int'},
{name: 'codigo', type: 'int'},
{name: 'descripcion', type: 'string'},
{name: 'habilitado', type: 'boolean'},
{name: 'linea', type: 'string'},
{name: 'marca', type: 'string'},
{name: 'precio', type: 'float'},
{name: 'tipo', type: 'string'}
]
});
var storeCodigo = Ext.create('Ext.data.Store', {
model: 'modelCodigo',
autoLoad: false,
sorters: {property: 'codigo', direction: 'ASC'},
proxy: {
type: 'ajax',
url: 'resources/php/productos.php',
extraParams: {
marca: marca,
categoria: selectionID
},
reader: {
type: 'json',
root: 'productos'
}
}
}).load({
callback: function(records, operation, success) {
Ext.ComponentQuery.query("Item form combobox[name=codigo]")[0].bindStore(storeCodigo);


itemWindow.setTitle("Categoria: " + selectionText + " - Marca: " + marca);
itemWindow.show();
}
});


}
}


and this is the view with the combo


Ext.define('compra.view.Item', {
extend: 'Ext.window.Window',
width: 280,
height: 180,
closable: true,
alias: 'widget.Item',
border: 1,
layout: {
type: 'fit',
pack: 'center',
align: 'center'
},
initComponent: function() {
this.items = [
{
xtype: 'form',
padding: '5 5 0 5',
border: false,
style: 'background-color: #fff;',
items: [
{
xtype: 'combobox',
name: 'codigo',
fieldLabel: 'Codigo',
displayField: 'codigo',
valueField: 'codigo',
queryMode: 'remote',
allowBlank: false,
forceSelection: true
},
{
xtype: 'combobox',
name: 'color',
fieldLabel: 'Color'
},
{
xtype: 'combobox',
name: 'talle',
fieldLabel: 'Talle'
},
{
xtype: 'textfield',
name: 'cantidad',
fieldLabel: 'Cantidad'
}
],
buttons: [
{
text: 'Agregar',
action: 'agregar'
}
]


}
],
this.callParent(arguments);
}


});

palakurthivishal
29 Jan 2014, 6:01 AM
Hello afidalgo,You are giving a background to the form(which is white in your case). I guess that is why your combo has become transparent, try giving it a different background-color and see if it gets changed. (also let me know :) )style: 'background-color: #fff;',

palakurthivishal
29 Jan 2014, 6:07 AM
Hello afidalgo,
By seeing at the screenshot, I feel like there may be a situation where you might have overridden a CSS class of Ext, which gives the border to all the components.

afidalgo
29 Jan 2014, 11:25 AM
I've been using a lot of combo boxes and all are ok. The main difference with this one is where the form is opened from.

Since the window containing this form is opened from a data view when an item is clicked
Is there any chance that some cls setting
On the data view can be affecting the form CSS?

I tried changing the form background as you mentioned, color is changed but the combo still shows transparent