I did tarted few weeks ago to use Ext Js with several forms and store, having issue with a multiselect field. The scroll is not displayed and field sometime expand to the form size when I click into.
I did try setting autoScroll and overflowXY without sucess ...
// Set up a model to use in our Store
Ext.define('Fonc', {
extend: 'Ext.data.Model',
fields: [
{name: 'FonctionId', type: 'int'},
{name: 'Fonction', type: 'string'}
]
});
// Set up a model to use in our Store
Ext.define('Act', {
extend: 'Ext.data.Model',
fields: [
{name: 'ActiviteId', type: 'int'},
{name: 'Activite', type: 'string'}
]
});
defaults: {
anchor: '100%'
},
fieldDefaults: {
labelAlign: 'left',
msgTarget: 'none',
invalidCls: '' //unset the invalidCls so individual fields do not get styled as invalid
},
/*
* Listen for validity change on the entire form and update the combined error icon
*/
listeners: {
fieldvaliditychange: function() {
this.updateErrorState();
},
fielderrorchange: function() {
this.updateErrorState();
}
},
updateErrorState: function() {
var me = this,
errorCmp, fields, errors;
if (me.hasBeenDirty || me.getForm().isDirty()) { //prevents showing global error when form first loads
errorCmp = me.down('#formErrorState');
fields = me.getForm().getFields();
errors = [];
fields.each(function(field) {
Ext.Array.forEach(field.getErrors(), function(error) {
errors.push({name: field.getFieldLabel(), error: error});
});
});
errorCmp.setErrors(errors);
me.hasBeenDirty = true;
}
getTip: function() {
var tip = this.tip;
if (!tip) {
tip = this.tip = Ext.widget('tooltip', {
target: this.el,
title: 'Error Details:',
autoHide: false,
anchor: 'top',
mouseOffset: [-11, -2],
closable: true,
constrainPosition: false,
cls: 'errors-tip'
});
tip.show();
}
return tip;
},
setErrors: function(errors) {
var me = this,
baseCls = me.baseCls,
tip = me.getTip();
errors = Ext.Array.from(errors);
// Update CSS class and tooltip content
if (errors.length) {
me.addCls(baseCls + '-invalid');
me.removeCls(baseCls + '-valid');
me.update(me.invalidText);
tip.setDisabled(false);
tip.update(me.tipTpl.apply(errors));
} else {
me.addCls(baseCls + '-valid');
me.removeCls(baseCls + '-invalid');
me.update(me.validText);
tip.setDisabled(true);
tip.hide();
}
}
}, {
xtype: 'button',
formBind: true,
disabled: true,
text: 'Créer le compte',
width: 140,
handler: function() {
var form = this.up('form').getForm();
// Normally we would submit the form to the server here and handle the response...
form.submit({
clientValidation: true,
async: false,
//waitMsg: 'Veuillez patienter ...',
url: 'php/create_user.php',
success: function(form, action) {
var fld_email = formPanel.getComponent('email');
var fld_password = formPanel.getComponent('password1');
I was becoming crazy, trying to solve one issue after anoter .... While I was developping an Item selector which was not working properly, i just integrated my whole site on step by step when ....
I did copy the MultiSelect and ItemSelector.js file from the exemples ../ux/ into the lib ... and bingo ... my multiselect is working and my itemselector as well ...
The question is why does .js example files are not the same than into the lib ??
Unfortunately not. Strange Behaviours .... the field expand to the whole form when I click into, then goes back to it's original form.
Working fine with 4.0
I have another form with a simple htmleditor and 2 hidden fields which also have a strange behaviours ...
I will keep the 4.0 for the scroll, but will have to translate the code for French, as I may not use locale translation of the 4.1 .... and then will try to fix the strange behaviours of my simple window ...
I was becoming crazy, trying to solve one issue after anoter .... While I was developping an Item selector which was not working properly, i just integrated my whole site on step by step when ....
I did copy the MultiSelect and ItemSelector.js file from the exemples ../ux/ into the lib ... and bingo ... my multiselect is working and my itemselector as well ...
The question is why does .js example files are not the same than into the lib ??