PDA

View Full Version : Ext usage difficulties and wishes



nassaja-rus
15 Jun 2008, 6:21 AM
I have collected the description of problems which to me stir or are inconvenient, and some wishes which I shall probably make work more conveniently.

I shall be glad to hear if you know, how to solve them with standard Ext, not using plug-ins and inline extensions.

I shall be glad, if my supervision will help with development of this outstanding library.

Ext.Toolbar

It will be convenient to have methods for grouped activation/deactivation of toolbar buttons which would receive an array of buttons id.
It would be convenient to link toolbar with it container. In a toolbar configuration in grid or dataView to appoint a buttons id array, which automatically would enabled at a grid/dataview selection and will automatically disabled without selection.


Ext.Window

Keys config options, reference to a window (window object) is not transferred in button handler, for which these keys are appointed
There is no opportunity to hide header(title) of a MessageBox window


Ext.form

The general for all forms:



It would be easier to have the direct reference to the form object from any fields in the form. The parameter ownerCt does not rescue, for example I want get access to window object from an form field. I have strucuture: Window->formPanel->fieldSet->textField and I must write long instruction with several ownerCt in it, but I fon't wan do this.
There is no event which would shoot after change of a field value. It will be convenient in a Ext.form.dateField, Ext.form.comboBox and at change field with setValue method. Now 'change' event fired on a field blur, that is rather inconvenient.
It would be desirable to have a method to enable/disable of all fields in the form, or on an array of fields id. That fields would be disabled, instead of a layer with the formPanel.


Ext.form.ComboBox:

emptyText in combobox sends on a server, in general there is no precise configuration of logic of work with emptyText. It would be desirable to set in configuration full switching-off of sending emptyText, and getValue/getRawValue methods.
The combobox work model with preloaded data and default value is not clear. It would be desirable to have configuration which would allow to load data in combobox at form rendering and to choose default value which has been placed in a combobox configuration. I mean a situation when comboBox have displayField, and in its configuration I specify id on which it is display necessary displayField value.


Ext.form.DateField:

In a calendar it is impossible to appoint a separate date format for viewing, for set and for submit to a server. And it is a frequent situation when I obtain data in one format, should display in other and send on a server in the third. There are some plugins for display of date, time, date and time, etc. All of them will win if adjustment of a format of date will be is made in a Ext corel
The annoying bug with cyrillic locales does not allow to display date in a format ' F m y ', dumping them for 1907 at a choice of any other field.


Ext.grid

There is no analogue simpleSelect (as in DataView) in checkBoxSelectionModel
After reloading data (by store.reload()) in the grid the viewing position is placed to the beginning of the grid, whether it is possible to update data in the grid without returning to the beginning?
The editable grid has problems in support comboboxes with displayField param.
There is no load event in gridPanel


P.S. I used the machine translation system, probably the text is awful, concern with understanding =)

Animal
15 Jun 2008, 11:57 PM
Some good points there. Particularly "It would be easier to have the direct reference to the form object from any fields in the form."

THere really should be an unbroken ownership/parent chain up and down the Ext Component hierarchy. And Fields -> BasicForm and Fields -> FormPanel is missing.

BasicForm::add should be



/**
* Add Ext.form components to this form.
* @param {Field} field1
* @param {Field} field2 (optional)
* @param {Field} etc (optional)
* @return {BasicForm} this
*/
add : function(){
for (var i = 0, len = arguments.length; i < len; i++) {
arguments[i].form = this;
arguments[i].ownerCt = this.ownerCt;
this.items.add(arguments[i]);
}
return this;
},



As you can see there are two linkages needed, one to the form, and one to the Container hierarchy.

So a BasicForm which is created as part of a FormPanel needs to know this, so FormPanel::createForm needs to be



createForm: function(){
delete this.initialConfig.listeners;
var f = new Ext.form.BasicForm(null, this.initialConfig);
f.ownerCt = this;
}

meej
15 Aug 2008, 12:19 PM
I too wish that the CheckboxSelectionModel were able to use simpleSelect. It makes much more sense to use simpleSelect with the checkbox paradigm than the traditional row selection model. Here's a small fix that will enable this behavior:



Ext.apply(Ext.grid.CheckboxSelectionModel.prototype, {

onMouseDown: function(e, t){
if(e.button === 0 && (this.simpleSelect || t.className == 'x-grid3-row-checker')){ // Only fire if left-click
e.stopEvent();
var row = e.getTarget('.x-grid3-row');
if(row){
var index = row.rowIndex;
if(this.isSelected(index)){
this.deselectRow(index);
}else{
this.selectRow(index, true);
}
}
}
}

});


You just have to override the onMouseDown event of Ext.grid.CheckboxSelectionModel to check if the model has simpleSelect enabled.