Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set width of jquery autocomplete widget #30

Closed
mgalgs opened this issue Sep 6, 2012 · 4 comments
Closed

Set width of jquery autocomplete widget #30

mgalgs opened this issue Sep 6, 2012 · 4 comments

Comments

@mgalgs
Copy link

mgalgs commented Sep 6, 2012

The autocompletion options seem match the width of the width of the text box by default: http://i.imgur.com/6YoCj.png

I can't figure out how to make it wider (like in the screenshot from the README.md) besides some ugly css hacks (that involve !important, yuck)...

It looks like the best way to do it in real life is sort of hackish, through the open event: http://jsfiddle.net/salman/gP7Ns/ However, specifying a javascript function through plugin_options isn't possible (it just comes out as an escaped string).

Suggested fix: not sure... Maybe an option to include that open hackage with the width as a parameter...

@crucialfelix
Copy link
Owner

did you see the comments in the css here ? :

https://github.com/crucialfelix/django-ajax-selects/blob/master/ajax_select/static/css/ajax_select.css#L20

you should be able to set max-width and it SHOULD work. let me know if it doesn't.

it doesn't seem to work here in a fiddle: http://jsfiddle.net/gP7Ns/117/

:(

I see there are a few google results for this same issue.

I'm not fond of the default styling of jquery ui at all. I would like to even support bootstrap's autocomplete at some point since it feels much more solid and looks nicer.

@crucialfelix
Copy link
Owner

@mgalgs
Copy link
Author

mgalgs commented Sep 7, 2012

+1 for twitter bootstrap, that would be amazing... However, I don't think it supports any styling of the result items, though it looks like it is possible through additional extensions (v 2.0 of tcrosen/twitter-bootstrap-typeahead seems to support it).

For now, I guess the open solution is the best route... How did you get it to work in those screenshots in the README.md?

@crucialfelix
Copy link
Owner

the screenshot is from the 1.1 version which used the old autocomplete plugin before itmwas rewritten and added to jquery ui.

honestly I still have that client on the old version because the styling looks better. so Id like to have better control. jqueryui looks ok for calendars. I guess its mainly the curved edges that dont look right for a dropdown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants