dhamaso / ufd

Automatically exported from code.google.com/p/ufd
GNU General Public License v2.0
0 stars 0 forks source link

"Show list on focus" option #29

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have added "showListOnFocus" option in the code of plugin, and i would like 
to add to trunk;

I have attached the modified code;

Thanks for the plugin!

Original issue reported on code.google.com by ezi...@gmail.com on 27 Sep 2010 at 6:28

Attachments:

GoogleCodeExporter commented 9 years ago
I just tried the latest version using showListOnFocus. Regardless of whether I 
initialize this parameter to true or false, the list still shows when the 
control receives focus.  I would prefer that the list NOT show when the control 
receives focus.  Am I missing something here?  Thanks for everyone's hard work 
on this.

$('select').ufd({
    listWidthFixed: false
    , showListOnFocus: false
});

Original comment by rren...@gmail.com on 28 Sep 2010 at 5:21

GoogleCodeExporter commented 9 years ago
A version with the option is attached with my message. I didnt have added in 
trunk code;
=]

Original comment by ezi...@gmail.com on 29 Sep 2010 at 3:12

GoogleCodeExporter commented 9 years ago
Maybe I'm missing something, but I downloaded and used the attached code in the 
original message for Defect 29, and it didn't work.  The dropdown still opens 
when it receives focus when I initialize the control as indicated.  I do not 
see any other attachments with your reply to my comment. I'm somewhat new to 
jQuery, and I'm not sure what you mean by "trunk code". Can you explain, and is 
there a later release of this plugin that I need?  Thanks for your help.

Original comment by rren...@gmail.com on 29 Sep 2010 at 10:54

GoogleCodeExporter commented 9 years ago
I just realized my error in implementation.  I initialize my ufd's with 
showListOnFocus : false on document.ready(), but when I rebind them (destroy(), 
then ufd() again), was not resetting the parameter upon rebinding.  So, I added 
the parameter to my rebinding function, and sure enough, now the list does not 
show when the control receives focus.

Thanks again for all your hard work and help on this issue.

Now, if I can just get my the default selected item to show when focus shifts 
to a ufd list, I'll be home free. ;)

Original comment by rren...@gmail.com on 29 Sep 2010 at 11:18

GoogleCodeExporter commented 9 years ago
It's working for me... Attach your test code to me.
The code that i referenced is of the first message.
if you access the source, you will see a trunk directory, that is the stable 
code of the plugin.

Original comment by ezi...@gmail.com on 29 Sep 2010 at 11:18

GoogleCodeExporter commented 9 years ago
Perfect! 
Any questions, i am available to reply!

Original comment by ezi...@gmail.com on 29 Sep 2010 at 11:23

GoogleCodeExporter commented 9 years ago
Now, I have a different problem.

I have 2 ufd controls, and one of them is a parent control to the other.  When 
I change the selected value of UFD1, I set the selected value of UFD2 
automatically in this sequence:

1) UFD1 selected item is changed.
2) UFD1 blur event is fired, which executes an ajax call to find the child list 
of items that corresponds to the selected value of UFD1.
3) The ajax call completes by returning a list of child items are are then 
bound to UFD2, which is then reinitialized with showListOnFocus : false.
4) After UFD2 has been reinitialized, I programmatically set the selected value 
of UFD2 to the first item in the child list.

The assignment of a value to UFD2 works, but the associated text for that 
option does not appear in the text box of the UFD2 control.  Is there a UFD 
function I need to call to refresh the text box so that the selected item text 
appears in the text box?

I know that the setting of the selected value in UFD2 works because of a 
subsequent ajax call I make in that control's blur event that performs a 
calculation. The calculation is working. I just need the selected item's text 
to appear in the UFD2 text box now.

In a standard HTML SELECT control, the child selector displays the 
automatically selected item's text.  But when I apply UFD with showListOnFocus 
: false, the selected item text does not appear when an item is 
programmatically selected.

Any insight is appreciated.

Original comment by rren...@gmail.com on 29 Sep 2010 at 11:40

GoogleCodeExporter commented 9 years ago
Found my answer to my latest issue in Issue 19 as noted below:

--
Comment 3 by project member thetoolman, Sep 15, 2010 
Yes it seems that this way of setting it does not fire a change event, so the 
plugin doesn't know. 

sberry2a has offered a reasonable solution, but an even cleaner one would be:

$('#select_id').val('abc').trigger("change");

Not yet sure of how I can be notified, polling this may be expensive.

--

This is very cool.  Thank you everyone who helped directly and indirectly.  I 
appreciate it very much.

Original comment by rren...@gmail.com on 29 Sep 2010 at 12:09

GoogleCodeExporter commented 9 years ago
thank you for your good reply!
I am using the ufd plugin and i am liking it too!

Original comment by ezi...@gmail.com on 29 Sep 2010 at 2:40

GoogleCodeExporter commented 9 years ago
Why is UFD not IE6-compliant?  I have a client/server web browser user control 
that is only IE6-compliant, and UFD does not behave the same inside that 
browser control as it does in IE8 in compatibility mode.

Any insight is appreciated.

Original comment by rren...@gmail.com on 29 Sep 2010 at 3:28

GoogleCodeExporter commented 9 years ago
In my opinion, maintain the ie6 support into javascript plugins only contribute 
to maintain the ie6 alive. I'm not in favor of it.

Original comment by ezi...@gmail.com on 29 Sep 2010 at 4:52

GoogleCodeExporter commented 9 years ago
The plug is iE6 compatible - plesae report any iE6 bugs!

Original comment by thetoolman on 8 Oct 2010 at 8:51

GoogleCodeExporter commented 9 years ago
Thank you for the code contribution.  

Committed to trunk - in fact I have changed the default behavior to this.  
Trying to make it similar to native select elements, and its true that they 
don't dropdown on focus.

Original comment by thetoolman on 8 Oct 2010 at 9:04

GoogleCodeExporter commented 9 years ago
Issue 41 has been merged into this issue.

Original comment by thetoolman on 5 Oct 2011 at 9:35