i'm using autocomplete user can easly enter data on inputs, this:
<? $a = new etiqueta(0, ''); $b = $a->autocomplete_etiquetas(); ?> <script type="text/javascript"> function cargar_autocomplete_etiquetas(){ $("#tags").autocomplete({ source: [<? echo $b; ?>] }); } </script>
$a = $b array result like: 'help','please',i','need','to,'be able to', 'select next item',' autocomplete';
and checked ui documentation, doesn't fith source method.. idea? i'm trying (edited bugai13 aportation):
<? $a = new etiqueta(0, ''); $b = $a->autocomplete_etiquetas(); ?> <script type="text/javascript"> function cargar_autocomplete_etiquetas(){ $("#tags").autocomplete({ source: [<? echo $b; ?>], multiple: true, multipleseparator: ", ", matchcontains: true }); } </script>
but don't know how it.. idea? .push , .pop functions autocomplete? or shall define, them?
thanks again!
ps: i'm getting adicted site! ps: come on dudes, think answer usefull many people ps: allowed offer paypal reward?
i've use following work multiple autocomplete tags ',' separator, hope your:
it's full code work. in case in parse function items json array, try add parse method:
$("#txttags").autocomplete(urlfactory.tags_autocomplete_url, { matchcontains: true, width: 320, max: 10, highlight: false, multiple: true, multipleseparator: ", ", scroll: true, scrollheight: 300, datatype: "json", parse: function (data) { var result = result.fromjson(data); var items = result.getjson("tags"); var arr; if (items != null) arr = items.split(","); return $.map(arr, function (row, i) { return { data: row, value: row, result: row } }); }, onitemselect: function () { }, formatitem: function (data, i, n, value) { if (value != null) { value = ltrim(value); value = rtrim(value); } return value; } });
so, need this:
function cargar_autocomplete_etiquetas(){ $("#tags").autocomplete({ source: [<? echo $b; ?>], multiple: true, multipleseparator: ", ", matchcontains: true }); }
Comments
Post a Comment