ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
How reset search Lookup popup and alert when not found ??
Title:
B
I
{code}
?
I use Lookup and CustomSearch: @(Html.Awe().Lookup("PersonsCustomSearch") .Controller("PersonsCustomSearchLookup") .ClearButton(false) .SearchOnChange(false) .CustomSearch(true)) and code below in SearchForm.cshtml @using DCMS.Models @{ Layout = null; } @using (Html.BeginForm()){ <input type="submit" class="btn btn-primary" value="Search" /> @Html.Awe().TextBox("Search").HtmlAttributes(new { style = "width:300px;" }).CssClass("awe-searchtxt").Placeholder("Search...").Prefix("Persons") } I have three question 1. I want to alert javascript box (sush as your keyword cannot query data) when user type text in @Html.Awe().TextBox("Search") and click <input type="submit" class="btn btn-primary" value="Search" /> and count of row in list = 0 (query not found) 2. When user press button lookup and have pop up search window if user not choose any item and click OK at right bottom then notice message in parent page such as <div id="message">you not choose any item !!</div> 3. I want reset lookup to initial lookup via javascript now I use $('#PersonsCustomSearch').val('').change(); then It just reset only text lookup , but TextBox and List in CustomSearch is not reset .
Save Changes
Cancel
nutfergie
asked at 02 Mar 2017
Answers
B
I
{code}
?
1. you can use this js: $(document).on('aweload', function(e) { var lst = $(e.target); if (lst.is('.awe-srl') && !lst.html()) { lst.append('<li style="text-align:center;padding:1em;"> no results found</li>'); } }); 2. usually this will be handled by your form validation, you can also bind to the `change` event, however change won't be triggered if the value hasn't changed as a result of clicking OK 3. you can call `$('#lookupid').data('api').initPopup()`
Save Changes
Cancel
Omu
answered at 03 Mar 2017
thx so much your answer for quesiton 1 and 3 For second question , Every time when user click Ok button at right bottom I want check text lookup for something . text lookup is blank (not choose in list) ---> js process 1 text lookup is not blank ( choose in list) ---> js process 2 Have method for handle onclick of popup Ok button ?
at 05 Mar 2017
nutfergie
well, if text should be blank only when the value is empty, so as I said you can bind to the `change` event, but if the value is already blank and the user clicks ok without selecting anything, change won't be triggered, and right now there is no other event
at 05 Mar 2017
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