php - auto-complete in yii using JavaScript -
I'm new to Yii I get values from the controller I have stored it in a variable and display the auto full function Have done If I alert the variable, then this value is showing. But in the actual code, the autocomplete box is empty, please help me fix it.
Thanks in advance.
My view: >
& lt ;! - content - & gt; & Lt; Div id = "content" & gt; & Lt; Div style = "padding: 10px;" & Gt; & Lt; A href = "& lt ;? php echo $ this-> createUrl ('/ Nimsoft / create') ;? & gt;" Title = "create new host" class = "btn btn-primary circle_ok" style = "text-decoration: none;" & Gt; Add a new host to the customer & lt; / A & gt; & Lt; Div style = "float: right" & gt; & Lt ;? Php echo CHtml :: link ('Client CSV Upload', Array ('/ Nimsoft / uploadCustomers'), array (' onclick '= & gt;' Return HSIIFAPend (this, {object type: "iframe", wrapperClassName: Full size ", align:" center "}) ',' class' = & gt; 'btn btn-primary', 'id' = & gt; 'upload_link',)); ? & Gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; H3 & gt; & Lt ;? Php htmlspecialchars ($ title); ? & Gt; & Lt; / H3 & gt; & Lt; H3 & gt; & Lt ;? Php echo $ title; ? & Gt; & Lt; / H3 & gt; & Lt; Div class = "innerr r" & gt; & Lt; Div class = "line-fluid" & gt; & Lt ;? Php $ obj = $ this- & gt; Widget ('zii.widgets.grid.CgrridView', array ('data provider' => $ dataprider, // 'afterAjaxUpdate' = & gt; '\' changeTRColor () \ '', '' view '= & gt; ; 'Name', 'value' = & gt; '_view', 'column' = & gt; array (array (// using an expression 'name' 'create_time' => $ Data-> gt; ; 'Name' = & gt; 'serviceId', 'value' = & gt; '$ data- & host_serviceid',), array ('name' = & gt; customer ',' host_name ',), array (' name '=' 'Value' = & gt; '$ data-> customer- & gt; cust_name',), array ('class' = & gt; cbttoncolumn ',' template '= & gt;' {delete} {update } ',)),)); $ Customer_names = array (); Forex Currency ($ user $ line) {$ customer_names [] = array_values ($ line); } Json_encode ($ customer_names); ? & Gt; & Lt; / Div & gt; & Lt; Html lang = "en" & gt; & Lt; Top & gt; & Lt; Meta charset = "UTF-8" & gt; & Lt; Title & gt; JQuery UI auto complete - default functionality & lt; / Title & gt; & Lt; Link rel = "stylesheet" href = "// code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> & Lt; Script src = "// code.jquery.com/jquery-1.9.1.js"></script> & Lt; Script src = "// code.jquery.com/ui/1.10.4/jquery-ui.js"></script> & Lt; Link rel = "stylesheet" href = "/ resources / demos / style.css" & gt; & Lt; Script type = "text / javascript" & gt; // encoded $ (function () {var availableTags = & lt ;? php echo json_encode ($ customer_names) ;? & gt;; / * "Action Script", "Applescript", "ASP", "Basic", "C "," Junk "," Lisboa "," Lisp "," Lisp "," Perl "," C ++ "," Closer "," Colf Fusion "," Erlang "," Fortran "," Groove "," Haskell "," PHP "," Python "," Ruby "," Scala "," Schema "* / Alert (Available Tag); $ (" #search "). Autocomplete ({source: availableTags});}); & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div class = "ui-widget" & gt; & Lt; Label = "search" & gt; Search Customer: & lt; / Label & gt; & Lt; Input id = "search" & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt; & Lt; Div class = "separator down" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt ;! - // content END - & gt; & Lt; Div class = "clearfix" & gt; & Lt; / Div & gt; & Lt ;! - // Sidebar Menu & amp; Content Cover END - & gt; & Lt; Div id = "footer" class = "hidden print" & gt; & Lt ;? Php $ this- & gt; Renderpartial ('application.views.layouts._footer_inc'); ? & Gt; & Lt; / Div & gt; To convert JSR to JSR, follow the code in your code
Available Tags = $. From SEJs (Available Tags);
Comments
Post a Comment