PDA

View Full Version : [1.1.1] Ext.ux.form.Select



andrei.neculau
27 Sep 2007, 12:28 AM
It really might sound stupid, with Multiselect (http://extjs.com/forum/showthread.php?t=13202) (provides multiselection; not wrapped in a ComboBox; no key navigation) and SelectBox (http://extjs.com/forum/showthread.php?t=6392) (provides grouping, from GroupComboBox, and key search for ComboBox) already out there, but I was in need of something else.

This is what I ended up with: an extension to ComboBox which provides multiselection.

Without any more comments, I give you Ext.ux.form.Select :)
Live Demo - http://www.andrei.neculau.home.ro/extjs/ux.form.Select/Select_test.htm
Attachment - you have the extension and a testcase inside of it.

Looking forward to reactions on this!

TO DO (not in the very near future)
------
- add key search (SelectBox)
- add grouping capability (GroupComboBox)

[November - ANNOUNCEMENT] This component was ported to Ext2.0 (http://extjs.com/forum/showthread.php?t=16841)
[GMT 10:20, Oct. 15 - ANNOUNCEMENT] Freezing development for Ext1.x (except fixing bugs) and porting this to Ext2.x soonish
[GMT 18:05, Oct. 8 - UPDATE ] Some bug fixes. Updated to v0.2
[GMT 23:21, Sep. 27 - NOTE] The testcase uses console.log (Firebug), so you will get an error about console in IE. I will change the testcase's code sometime soon. [update]: JeffHowden - I need to use ext-debug-all.js and it will work in IE also. [later update]: fixed
[GMT 12:00, Sep. 27 - UPDATE ] Small bug fix. Not changing version number. Please re-download.

mdissel
27 Sep 2007, 1:36 AM
Nice, thanks!

galdaka
27 Sep 2007, 2:57 AM
Live example please!


Thanks in advance,

galdaka
27 Sep 2007, 11:30 AM
Hi,

Thanks for live demo. Good work.

I have IE6. View the image.

andrei.neculau
27 Sep 2007, 1:20 PM
@galdaka - yes, because I've chosen to "alert" about value changes using firebug's console.log. It's mentioned there. I will have to change the testcase a bit, and put some "Get value" button, but I was in a rush. So IE for now will give that error, because IE doesn't know what console is.

JeffHowden
27 Sep 2007, 4:33 PM
@galdaka - yes, because I've chosen to "alert" about value changes using firebug's console.log. It's mentioned there. I will have to change the testcase a bit, and put some "Get value" button, but I was in a rush. So IE for now will give that error, because IE doesn't know what console is.
IE knows about console if you use ext-debug-all.js instead of ext-all.js ;)

andrei.neculau
28 Sep 2007, 10:59 PM
@JeffHowden
Thanks for clearing that out. I wasn't sure, and now I'm busy with traveling, so I cannot investigate.

catacaustic
7 Oct 2007, 8:57 PM
This was just what I needed to find!! !

With a bit of tweaking I got this working in my EditorGrid.

Thank you so much!

andrei.neculau
8 Oct 2007, 4:48 AM
@catacaustic: Any chance of knowing what that "tweaking" was? :)

andrei.neculau
8 Oct 2007, 9:08 AM
[bump]
Updated with small bug fixes to v0.2

catacaustic
8 Oct 2007, 2:20 PM
All that I had to do was to get the renderer working properly for the grid. I added a "getTextValue" function so that I could get the text that's displayed (Item 1, Item 2) instead of the comma-separated values (1, 2). So, nothing at all serious, really only useful for using this in a editable grid as I have.

andrei.neculau
15 Oct 2007, 1:20 AM
@catacaustic - doesn't getRawValue do that? i.e. getting the displayed textual value?

Announcement - I won't enhance this component (for Ext 1.x), but go into porting it to Ext2.x and enhance that one

jaanus
17 Oct 2007, 6:37 AM
I had an issue with using it in an EditorGrid. The store value type is integer instead of a string.


removeValue:function(v){
v = v+''; //typecasting to string
var value = this.getValue();
var valueArray = value.length?value.split(','):[];
if (valueArray.indexOf(v) != -1){
valueArray.remove(v);
}

this.setValue(valueArray.join(','));
}

I also added the same line into the beginning of the setValue() method.

Keep up the good work ;)

andrei.neculau
19 Oct 2007, 1:42 PM
@jaanus - I will dig into that as soon as possible (2-3 days). Thanks for your fix!

wvuong
19 Oct 2007, 7:27 PM
thanks for the good work. i'm looking forward to your version for 2.0.

jaanus
20 Oct 2007, 12:56 AM
I decided to change the underlying data format to an array instead. It should be faster this way - no need to convert a string to array and back each time you change a value.

andrei.neculau
31 Oct 2007, 1:51 PM
@jaanus - very much true. I took on your note, and it works like that in the version for Ext 2.x

The new version can be found here (http://extjs.com/forum/showthread.php?t=16841).

jaanus
1 Nov 2007, 8:27 AM
Wow, thanks mate. Didn't hear from you couple of days, thought you were dead or something...apparently...you have been busy coding the upgrade instead...anyway your Ext.ux.Select was the only reason why I have been stuck with the 1.1.1 and I simply had no time, skill etc to upgrade it myself.

andrei.neculau
1 Nov 2007, 9:45 AM
@jaanus - :) No, I was just busy with life. Coding the new Select component took only one day. Happy coding and good luck with your application (between me and you, before I saw the upgrade guide.. it felt a bit weird to upgrade to 2.0. Their guide is simply perfect)

jaanus
1 Nov 2007, 10:14 AM
Not just the guide, as far as I have read and used their code, it is simply perfect - it is fast, readable, well documented, easily extensible, strong support for OOP...the list goes on. I almost forgot to mention they have a great community :)

tassz
17 May 2008, 4:10 AM
Hi, I'm new to extjs...

Have a cfgrid and would like to know how to add your multiselect combo.. If you could send an example, it ill be greatly appreciated!



thanks:)
Tassz

tassz
22 May 2008, 3:00 AM
Hi Thanks!:)

AmitOlsys
17 Sep 2008, 10:11 PM
Dear Andrei,
Great work,
one thing I wanted to know that can I use this multiselect dropdown in editor-grid panel. as an editor. what I have to do to make it work with Editor-grid panel.
let me know if you have any confusion.

Thanks and Regards
AmitOlsys


It really might sound stupid, with Multiselect (http://extjs.com/forum/showthread.php?t=13202) (provides multiselection; not wrapped in a ComboBox; no key navigation) and SelectBox (http://extjs.com/forum/showthread.php?t=6392) (provides grouping, from GroupComboBox, and key search for ComboBox) already out there, but I was in need of something else.

This is what I ended up with: an extension to ComboBox which provides multiselection.

Without any more comments, I give you Ext.ux.form.Select :)
Live Demo - http://www.andrei.neculau.home.ro/extjs/ux.form.Select/Select_test.htm
Attachment - you have the extension and a testcase inside of it.

Looking forward to reactions on this!

TO DO (not in the very near future)
------
- add key search (SelectBox)
- add grouping capability (GroupComboBox)

[November - ANNOUNCEMENT] This component was ported to Ext2.0 (http://extjs.com/forum/showthread.php?t=16841)
[GMT 10:20, Oct. 15 - ANNOUNCEMENT] Freezing development for Ext1.x (except fixing bugs) and porting this to Ext2.x soonish
[GMT 18:05, Oct. 8 - UPDATE ] Some bug fixes. Updated to v0.2
[GMT 23:21, Sep. 27 - NOTE] The testcase uses console.log (Firebug), so you will get an error about console in IE. I will change the testcase's code sometime soon. [update]: JeffHowden - I need to use ext-debug-all.js and it will work in IE also. [later update]: fixed
[GMT 12:00, Sep. 27 - UPDATE ] Small bug fix. Not changing version number. Please re-download.

AmitOlsys
18 Sep 2008, 1:09 AM
Dear catacaustic,
I also wanted to use this multiselect Combo in editorgrid. as for edit purposes.please let me know how can I use this for column 'Term' in editor-grid.

columns:[{
header:'Term'
,id:'Term'
,align:'center'
,dataIndex:'Term'
,width:75
,sortable:false
,editor: new Ext.form.ComboBox({
typeAhead: true,
triggerAction: 'all',
transform:'Term',
lazyRender:true,
listClass: 'x-combo-list-small'
})
}Thanks and Regards
AmitOlsys


This was just what I needed to find!! !

With a bit of tweaking I got this working in my EditorGrid.

Thank you so much!

bhangale.parag
8 Apr 2009, 2:31 AM
HI ,
I saw the demo it looking good but i try to use it then i get the error "Ext.View is undefined".
ow can i resolve this error please help me.