ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
autocomplete on a popup?
Title:
B
I
{code}
?
Is there any sample code for creating an autocomplete on a popup view? The list of the my autocomplete always appears on the view behind the popup view...
Save Changes
Cancel
CuLacGionTan
asked at 09 Jun 2015
Answers
B
I
{code}
?
there isn't but I just tried it in the main demo modified DinnerInput.cs like this: [Required] [UIHint("Autocomplete")] [AweUrl(Controller = "CategoryAutocomplete", Action = "GetItems")] public string Name { get; set; } and it works with the jQueryUI popup, with the bootstrap popup it goes behind for bootstrap modal you need to add this css in your Site.css (http://stackoverflow.com/a/24803934/112100) .ui-autocomplete { z-index: 5000; } try to use the same versions of jqueyry, jqueryui as in the main demo, if it still doesn't work, copy all the css from Common.css
Save Changes
Cancel
Omu
answered at 09 Jun 2015
It works for me by just add .ui-autocomplete { z-index: 5000; } to my Site.css file. Can you please explain a little bit? Thanks a lot
at 09 Jun 2015
CuLacGionTan
it depends on all other css that you have in your project, and versions of jqueryui, z-index is used for positioned elements (abosulte, relative, fixed) to determine which one is in front of the other
at 09 Jun 2015
Omu
Thanks a lot. Now I have my autocomplete working but I have another issue. One of the values of my item is chosen from autocomplete. I saved it to database. And now I want to edit that item. Is there anyway to bind the chosen value to my autocomplete meaning the value will show up on my autocomplete whenever I want to edit my item? I think one solution is using autocompletefor, right? So in such case how I convert this to autocompltefor: @Html.Awe().Autocomplete("ChannelList").Url(Url.Action("GetItemsForAutocomplete", "SRS"))
at 09 Jun 2015
CuLacGionTan
usually you have a ViewModel that you fill with data (viewmodel.Property1 = "fruits" ) from the Db and you return the View(viewModel) and in the the view you have Html.Awe().Autocomplete("Property1"), that's it; have a look at this demo: http://demo.aspnetawesome.com/GridCrudDemo
at 09 Jun 2015
Omu
I could not see the Edit view there, only create view???
at 09 Jun 2015
CuLacGionTan
the Edit action returns the Create view return PartialView("Create", input);
at 09 Jun 2015
Omu
I updated to version 4.7 and now if I use .ui-autocomplete { z-index: 5000; }, it no longer works at all. I think the reason is when the autocomplete rendered, there are 2 classes .ui-autocomplete. How can I fix this?
at 31 Jul 2015
CuLacGionTan
it still works for me (4.7.3), and I only see one .ui-autocomplete, maybe you're referencing jQueryUI twice
at 31 Jul 2015
Omu
You were absolutely right, I were referencing JqueryUi twice. Can you please explain a little bit? If I reference JqueryUi twice, list of my autocomplete appear behind the popup...Anw Thanks a lot
at 13 Aug 2015
CuLacGionTan
well if you reference anything twice it ca break the script, and you get js errors
at 13 Aug 2015
Omu
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK