Enlever le bouton Search en bas du formulaire¶
Pour enlever le bouton Search du formulaire du Cut fits, il faut dans le fichier form.js (dans client-user/js/components/form/) :
- Creer un bouton Search et reprendre le code qui si trouve dans buttons de la fonction sitools.component.users.datasets.forms.superclass.constructor.call
- Avant l'appel de cette fonction, tester si le formulaire appelé est du type Cut Fits.
- Si oui mettre le bouton invisble grace à la fonction setVisible(false).
- Et bien sur mettre le bouton crée entre crochet dans la balise buttons de sitools.component.users.datasets.forms.superclass.constructor.call
Voici mon code qui fait tout cela
var searchButton = testButton = new Ext.Button({
id: 'searchButton',
text : i18n.get('label.search'),
scope : this,
handler : function () {
this.onSearch(config);
}
});;
if(config.formParameters[0].type == "CUTFITSFORMWITHNAME"){
searchButton.setVisible(false);
}
sitools.component.users.datasets.forms.superclass.constructor.call(this, Ext.apply({
height : config.formHeight,
width : config.formWidth,
autoScroll : true,
items : [ this.componentList ],
layout : "absolute",
// layoutConfig : {
// pack : "center",
// align : "middle"
// },
buttons : [ searchButton],
listeners : {
scope : this,
resize : function () {
if (!Ext.isEmpty(this.componentList.getEl())) {
var cmpChildSize = this.componentList.getSize();
var size = this.body.getSize();
var xpos = 0, ypos = 0;
if (size.height > cmpChildSize.height) {
ypos = (size.height - cmpChildSize.height) / 2;
}
if (size.width > cmpChildSize.width) {
xpos = (size.width - cmpChildSize.width) / 2;
}
this.componentList.setPosition(xpos, ypos);
}
}
}
})),