PDA

View Full Version : Extjs 4.0.7 Combobox in EventStore, record desappear



stefziva
29 Oct 2012, 3:03 AM
hi everybody,

Sorry for my english, but i'm french and i use extjs since few month, i have a problem not repertoriate in your bug fixe (i think).
First, i use extjs 4.0.7 and last version of extensible 1.5.1 (calendar).

2 solutions for me (upgrade my extjs or use a bugfixe).

my calendar is ok exept one thing, when i use the calendar much time, i have a problem with a load record of combobox ... the value of record desappear when i open a eventStore ... but this problem is not appear at the beginning ... it appear when i use calendar like few minutes ... and the unique solution is refresh the page :(

config :


Ext.Loader.setConfig({
enabled: true,
disableCaching: false,
paths: {
"Extensible": "src"
}
});


Combobox configuration:


Ext.override(Ext.form.field.ComboBox, {
createPicker: function() {
var me = this,
picker,
menuCls = Ext.baseCSSPrefix + 'menu',
opts = Ext.apply({
pickerField: me,
selModel: {
mode: me.multiSelect ? 'SIMPLE' : 'SINGLE'
},
floating: true,
hidden: true,
ownerCt: me.ownerCt,
cls: me.el.up('.' + menuCls) ? menuCls : '',
store: me.store,
displayField: me.displayField,
focusOnToFront: false,
pageSize: me.pageSize,
tpl: me.tpl,
loadMask: me.queryMode === 'local' ? false: true
}, me.listConfig, me.defaultListConfig);

picker = me.picker = Ext.create('Ext.view.BoundList', opts);
if (me.pageSize) {
picker.pagingToolbar.on('beforechange', me.onPageChange, me);
}

me.mon(picker, {
itemclick: me.onItemClick,
refresh: me.onListRefresh,
scope: me
});

me.mon(picker.getSelectionModel(), {
'beforeselect': me.onBeforeSelect,
'beforedeselect': me.onBeforeDeselect,
'selectionchange': me.onListSelectionChange,
scope: me
});

return picker;
}
});


the combobox in my enventStore :


{
xtype : 'fieldcontainer',
fieldLabel: 'Campagne',
layout: 'column',
items: [
{
xtype : 'combo',
allowBlank: false,
itemId : 'comboCampagne',
id : 'comboCampagne',
store : campagneStore,
forceSelection : true,
queryMode : 'local',
displayField : 'name',
valueField: 'value',
name: Extensible.calendar.data.EventMappings.Campagne.name,
columnWidth: .30
},{
xtype: 'button',
margin: '0 0 0 20',
text: 'Ajouter Campagne',
columnWidth: .25,
listeners: {
click: function(button, event){
Ext.create('Ext.window.Window', {
title: 'Ajout Campagne',
id: 'windowCampagne',
height: 110,
width: 290,
//layout: 'fit',
items: [{ // Let's put an empty grid in just to illustrate fit layout
xtype: 'textfield',
name: 'campagne',
id: 'textCampagne',
fieldLabel: 'Entrez Campagne',
margin: '10 0 0 10',
anchor: '100%'
},{
xtype: 'button',
margin: '10 0 0 100',
text: 'Ajouter',
listeners: {
click:
function(button, event){
Ext.Ajax.request({
url: 'ajoutCampagne.php',
params:{
id_calendrier: Ext.getCmp('calendrier').getValue(),
nom_campagne: Ext.getCmp('textCampagne').getValue()

},
success: function (){
campagneStore.load({
params: {
id_base: Ext.getCmp('calendrier').getValue()
},
callback: function(r,options,success) { }
});
Ext.getCmp('windowCampagne').close()
}
});
}



}
}]
}).show();

}
}
}]

}



Thanks for your help and i hope that this forum can help me.

Stéphane


Edit : the store of my combobox




var campagneStore = Ext.create('Ext.data.Store',{
model: 'rout',
storeId: 'campagneStore',
fields: ['value', 'name'],
proxy: {
type: 'ajax',
url: 'campagne.php',
reader: {
type: 'json',
root: 'campagne'
}
},
autoLoad: false
});

my model :




Ext.define('rout', {
extend: 'Ext.data.Model',
fields: [
{name: 'value', type: 'int'},
{name: 'name', type: 'string'}
]
});

mitchellsimoens
1 Nov 2012, 8:04 AM
Personally I would upgrade before I tried to use some overrides to fix a bug

stefziva
2 Nov 2012, 7:16 AM
ok thanks for your reply i will update the code and i will tell you what happens

Stéphane