javascript - JuiceUI Autcomplete by first letter only -
i using juiceui autocomplete command in web application.
if type 'a' textbox values there 'a' anywhere in string.
i need display values start letter 'a' or 'ab' etc...
i seen post on stackoverflow : jquery-autocomplete filter match first letter
this need maintain juiceui command in application without having go , swap out code, alter web config , remove references etc...
any assistance great.
thanks
edit: html :
asp:textbox runat="server" id="_default" clientidmode="static" width="95%" /> juice:autocomplete runat="server" targetcontrolid="_default" id="juicecombo" /> code behind:
method called page load event
var c = clubs.enum_allclubs.tolist(); // club count build our array datasource int clubcount = c.count(); // _clubnames = new string[clubcount]; (int = 0; < c.count; i++) { juice.autocompleteitem newitem = new autocompleteitem(); newitem.label = c[i].displayname; newitem.value = c[i].clubname; items.add(newitem); } juicecombo.sourcelist = items; juicecombo.databind(); edit : generated html & javascript in repsonse comment
<script type="text/javascript"> //<![cdata[ // juice initialization (function() { if(typeof(window.juice) !== 'undefined' && window.juice) { window.juice.widgets = [{"widgetname":"autocomplete","id":"_default","uniqueid":"juicecombo","options":{"source":[{"label":"a test display label1","value":"a test value1"},{"label":"b test display label2","value":"b test value2"},{"label":"c test display label3","value":"c test value3"}]},"encodedoptions":[],"events":["open","focus","close","create","response","search","select","change"],"postbacks":[]}]; window.juice.cssurl = '/content/themes/fresh-squeezed/jquery-ui-1.9.0.custom.css'; } })();function webform_onsubmit() { if (typeof(window.juice) !== 'undefined' && window.juice) { window.juice.onsubmit(); }; homecoming true; } //]]> </script> ....... .......... .............. <script type="text/javascript"> //<![cdata[ sys.webforms.pagerequestmanager._initialize('scriptmanager1', 'mainloginform', [], [], [], 90, ''); //]]> </script> <input name="_default" type="text" id="_default" data-ui-widget="autocomplete" style="width:95%;" class="ui-autocomplete-input" autocomplete="off"> <span role="status" aria-live="polite" class="ui-helper-hidden-accessible">3 results available, utilize , downwards arrow keys navigate.</span> ....... .......... .............. <input id="_juicewidgetoptions" name="_juicewidgetoptions" type="hidden"> <ul class="ui-autocomplete ui-menu ui-widget ui-widget-content ui-corner-all" id="ui-id-1" tabindex="0" style="z-index: 1; display: none; width: 284.77777767181396px; top: 379px; left: 613px;"> <li class="ui-menu-item" role="presentation"><a id="ui-id-2" class="ui-corner-all" tabindex="-1">a test value1 & croquet</a> </li><li class="ui-menu-item" role="presentation"><a id="ui-id-3" class="ui-corner-all" tabindex="-1">b test value1</a> </li><li class="ui-menu-item" role="presentation"><a id="ui-id-4" class="ui-corner-all" tabindex="-1">c test value1</a></li></ul> javascript jquery asp.net ajax juice-ui
No comments:
Post a Comment