PDA

View Full Version : [OPEN-96][3.x] MultiSelect does not support anchor



flylaputa
15 Jul 2009, 6:52 AM
Ext version tested:

Ext 3.0.0Adapter used:

Browser versions tested against:

FF3Operating System:

WinXP ProDescription:
I am not sure if this is a feature or a bug, but since MultiSelect extends form fields, I would expect it to support an anchor config just like other fields.
[/list]

Test Case:
In: multiselect-demo.js, replace


width: 250,
height: 200,

with


anchor: '80%',

See this URL : http://

Steps to reproduce the problem:

The result that was expected:

The multislect field should expand to 80% of the panel width.The result that occurs instead:

The multiselect field attains it's default size.Screenshot or Video:

Debugging already done:

nonePossible fix:

not provided

mjlecomte
16 Jul 2009, 1:07 PM
Looks like Multiselect internally uses a Fieldset that gets configured implicitly with width/height only at the moment.



// private
onRender: function(ct, position){
Ext.ux.form.MultiSelect.superclass.onRender.call(this, ct, position);

var cfg = {
renderTo: this.el,
title: this.legend,
height: this.height,
width: this.width,
style: "padding:0;",
tbar: this.tbar,
bodyStyle: 'overflow: auto;'
};

var fs = this.fs = new Ext.form.FieldSet(cfg);



This could be changed so it honor a width/height pair or an anchor config easily using this:


// private
onRender: function(ct, position){
Ext.ux.form.MultiSelect.superclass.onRender.call(this, ct, position);

var cfg = {
renderTo: this.el,
title: this.legend,
style: "padding:0;",
tbar: this.tbar,
bodyStyle: 'overflow: auto;'
};

// do not apply width and height if anchor specified
if (this.anchor){
Ext.apply(cfg, {
height: this.height,
width: this.width
});
}

var fs = this.fs = new Ext.form.FieldSet(cfg);



The above does not address if you wanted to specify an anchor width along with a height, but I don't know if that combination is intentionally honored anyway.



anchor: '60%', // configures the width
height: 200, // configures fixed height

flylaputa
20 Jul 2009, 1:37 AM
I think textArea supports an anchor width with a fixed height layout. I don't know about other form items, perhaps someone else can shed some light.

mjlecomte
20 Jul 2009, 4:11 AM
I believe they do, however I do not know if that is intentional is my point.

Depending on the answer to that, a change might be made to fieldset potentially.

mschwartz
20 Jul 2009, 4:51 AM
ItemSelector doesn't support anchor either.

And since they use DataView, you can't get a horizontal scroller if the left/right boxes are too narrow to read the entire string inside - which would be nice.

flylaputa
22 Jul 2009, 8:21 AM
A quick reply hoping to attract more attention as I saw this thread has sunk to page 3.

mjlecomte
22 Jul 2009, 9:39 AM
Something that might be helpful for the developer is if the code I posted works for you satisfactorily or not?

Animal
22 Jul 2009, 11:43 AM
Why does it contain a fieldset? If there must be a fieldset, the MultiSelect should extend Fieldset. That way the Container->Component hierarchy is not broken, and all layouts would work.

flylaputa
23 Jul 2009, 1:01 AM
Something that might be helpful for the developer is if the code I posted works for you satisfactorily or not?

Well... ideally I would like to have an anchor width and a specified height, but I thought you are not sure if that is intentionally supported.

Animal
23 Jul 2009, 3:33 AM
It's got to be refactored to be a Container.

It should not extend Field, it should implement the interface of Field so that it can be "worked" by a form.

mjlecomte
23 Jul 2009, 4:20 AM
Yeah, like Animal mentions, I think it was mentioned long ago that this ux needs some refactoring / cleanup. My posted code is just a band aid.

mschwartz
24 Jul 2009, 4:39 AM
The next generation of Ext should redo forms entirely. We've had this discussion already.

flylaputa
29 Jul 2009, 1:00 AM
So is there is quick override that will make this ux support an anchor width and a fixed height?

mjlecomte
29 Jul 2009, 4:40 AM
As a quick hack, you could try something like below. Keep in mind what was stated above though.



// private
onRender: function(ct, position){
Ext.ux.form.MultiSelect.superclass.onRender.call(this, ct, position);
var cfg = {
renderTo: this.el,
title: this.legend,
style: "padding:0;",
tbar: this.tbar,
bodyStyle: 'overflow: auto;',
height: this.height,
width: this.width
};

// do not apply width if anchor specified
if (this.anchor){
cfg.anchor = this.anchor;
delete cfg.width;
}

var fs = this.fs = new Ext.form.FieldSet(cfg);

this.view = new Ext.ListView({
...

marcora
21 Dec 2009, 8:15 AM
This bug is still present in v3.1. It would be great if it got fixed in v3.1.1

mschwartz
29 Mar 2010, 11:43 AM
http://jcwinnie.biz/wordpress/imageSnag/clouseau.jpg

bimp

evant
29 Mar 2010, 2:41 PM
MultiSelect is being rewritten. Stay tuned.