-
29 Oct 2012 3:03 AM #1
Unanswered: Extjs 4.0.7 Combobox in EventStore, record desappear
Unanswered: Extjs 4.0.7 Combobox in EventStore, record desappear
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 :
Combobox configuration:Ext.Loader.setConfig({
enabled: true,
disableCaching: false,
paths: {
"Extensible": "src"
}
});
the combobox in my enventStore :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;
}
});
{
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
my model :
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
});
Ext.define('rout', {
extend: 'Ext.data.Model',
fields: [
{name: 'value', type: 'int'},
{name: 'name', type: 'string'}
]
});
-
1 Nov 2012 8:04 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,118
- Vote Rating
- 453
- Answers
- 3160
Personally I would upgrade before I tried to use some overrides to fix a bug
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
2 Nov 2012 7:16 AM #3
ok thanks for your reply i will update the code and i will tell you what happens
Stéphane


Reply With Quote