Skip to content
Snippets Groups Projects
Commit 68bd0328 authored by legac's avatar legac
Browse files

ExtJS 4.2: Migrate the ComboBox.

parent 88fa7af5
No related branches found
No related tags found
No related merge requests found
......@@ -19,8 +19,18 @@ categoriesLeaf = dbui.Window(closable=True,
autoHeight=True,
widht=500)
harvestersLeaf = dbui.Window(closable=True,
anchor='100%',
items=[dbui.to_formPanel(db['harvesters'])],
title="Add harvester ...",
defaults={'anchor': '90%'},
modal=True,
autoHeight=True,
widht=500)
formNode = dbui.Node(T('Forms'))
formNode.add_child(T("categories"), categoriesLeaf)
formNode.add_child(T("harvesters"), harvestersLeaf)
#
# the grid node
......
......@@ -10,6 +10,13 @@ if (App.BasePanelWithSelector) {
});
}
if (App.form.field.ComboBox) {
Ext.apply(App.form.field.ComboBox.prototype, {
textSelect: 'Sélectioner un(e) ',
});
}
if (App.form.DictField) {
Ext.apply(App.form.DictField.prototype, {
textAdd: 'Ajouter',
......
/**
* The ComboBox is an Ext.form.ComboBox linked to an App.data.DirectStore.
* This is Ext.form.field.ComboBox linked to a database table.
*
* The store attribute is equal the table name when the widget
* is configured. It is replaced by an Ext.data.store.Direct
* in the initialization phase of the component.
*
*/
Ext.define('App.form.ComboBox', {
Ext.define('App.form.field.ComboBox', {
extend: 'Ext.form.ComboBox',
extend: 'Ext.form.field.ComboBox',
alias: 'widget.xcombobox',
// Predefined setting
mode: 'remote',
editable: false,
selectOnFocus: true,
// Works in auto completion mode when the user type value.
// In any case the value should belongs to the list.
editable: true,
forceSelection: true,
queryMode: 'local',
triggerAction: 'all',
typeAhead: true,
// private properties for internationalization
textSelect: 'Select a ',
// private method require by the ExtJs component model
initComponent: function () {
......@@ -21,14 +29,14 @@ Ext.define('App.form.ComboBox', {
// defined the empty text from the field label
if (this.fieldLabel && !this.emptyText) {
this.emptyText = "Select a " + this.fieldLabel + " ...";
this.emptyText = this.textSelect + this.fieldLabel + " ...";
}
// link the combobox to the data store
// link the ComboBox to the data store
this.store = App.getStore(this.store);
// construct the underlying class. DON'T MOVE
App.form.ComboBox.superclass.initComponent.call(this);
// construct the underlying class.
App.form.field.ComboBox.superclass.initComponent.call(this);
// load the store if not yet done
if (this.store.getCount() === 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment