waseem02 / jquery-asmselect

Automatically exported from code.google.com/p/jquery-asmselect
0 stars 0 forks source link

disabled options not disabled when initializing the input #15

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. create a <select> with a disabled="1" option
2. load page
3. the option in asmselect is not disabled

What is the expected output? What do you see instead?
the option should bedisabled

What version of the product are you using? On what operating system?
1.4beta

Please provide any additional information below.
I've made my own change in the source to do the stuff.
jquery.asmselect.js line 184 :

instead of:

   addSelectOption(id);

replacement :

   if ($t.is(":disabled"))
      addSelectOption(id, true);
   else
      addSelectOption(id); 

Original issue reported on code.google.com by jeremy.r...@gmail.com on 18 Mar 2009 at 4:18

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Jeremy,

Thanks for the message. asmSelect is using this disabled attribute internally 
for
it's own purpose, but if I can make it support an external disabled attribute 
then it
seems like a good thing to add. I will do my best to put this in 1.0.5. 

Thanks,
Ryan

Original comment by ryancram...@gmail.com on 29 Mar 2009 at 7:23

GoogleCodeExporter commented 8 years ago
Hi Ryan,  is there a workaround for now that will allow us to disable an 
asmSelect?
I tried wrapping the control is a disabled div, but to no avail. Also tried 
adding 
the disabled attribute directly to asmlist0, asmselectContainer, etc.

Thanks,
J.R.

Original comment by JRBenn...@gmail.com on 17 Apr 2009 at 4:15

GoogleCodeExporter commented 8 years ago
In simple multiple select if option are selected AND disabled you can not 
unselect them.
To have same function at line 264 replace 
var $item = $("<li></li>")
.attr('rel', optionId)
.addClass(options.listItemClass)
.append($itemLabel)
.append($removeLink)
.hide();

with 

var $item = $("<li></li>")
.attr('rel', optionId)
.addClass(options.listItemClass)
.append($itemLabel);
$item.hide();
if(!$O.attr('disabled'))
  $item.append($removeLink);

Davide

Original comment by SaDjeh...@gmail.com on 31 Mar 2010 at 2:20