Opened 13 years ago

Last modified 13 years ago

#8191 confirmed New Feature

No API to get all selected values of Select UIElement (multiple select list)

Reported by: Krishna Owned by:
Priority: Normal Milestone:
Component: General Version: 3.0
Keywords: Cc: rkanade@…

Description

I have a custom dialog where I have select UI element with attribute multiple set to 'multiple'. Now there is no way (or any documentation) to retrieve all (multiple) selected values of this 'Select' element. Please let me know how to retrieve the multiple selected values of 'Select'.

For example :

type:'select', id:'selected_attr', label:'Attribute', multiple:'multiple', style:'width:220px', items:loadAttributes()

var selectObj = this.getContentElement('info','selected_attr');

selectObj.getValue() is returning me always the first selected item, but not all selected values.

Change History (5)

comment:1 Changed 13 years ago by Jakub Ś

Status: newconfirmed
Type: BugNew Feature

It seems that we have simply forgotten about providing getValue(s) method for multiple select-list.

Confirming this ticket as a new feature to added.

comment:2 Changed 13 years ago by Jakub Ś

Version: 3.6.13.0

comment:3 Changed 13 years ago by Krishna

Thanks for confirming. When can we expect this feature to be available? Any time frame that you can provide?

regards, Krishna N

comment:4 in reply to:  1 Changed 13 years ago by Krishna

Replying to j.swiderski:

It seems that we have simply forgotten about providing getValue(s) method for multiple select-list.

Confirming this ticket as a new feature to added.

Thanks for confirming. When can we expect this feature to be available? Any time frame that you can provide?

regards, Krishna N

comment:5 Changed 13 years ago by Jakub Ś

It is hard to say when it is going to be implemented as there are many important features that are waiting in line. All I can say is that we are implementing them as fast as we can.

I know that this answer may not satisfy you so let me give you a temporary solution to your problem. You can always retrieve the native DOM object from CKEditor object.

These links should be helpfull:
http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.ui.dialog.select.html#getInputElement and http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.domObject.html#$

From the above links you should know that in your JS file E.g. for dialog you can use the following code which will give you access to native select DOM object:

var selectList = this.getInputElement().$;

From that point it's easy - all you have to do is google for the solution on how to retrieve values from multiselect lists in native JS. Here is a sample link:
http://www.digitalamit.com/blog/blog/23.html

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy