Question

Steps to reproduce:

i created a hai.html and using pagemod i injected scripts into that, here is the code and that hai.html https://github.com/suneeshtr/trigger-test.git

Actual results:

injection of scripts and everything works fine except triggering. when i tried to append a file it works..

here is a part of code:

alert("content");
$(document).ready(function() {
var values = [{val:'santiagotactivos', meta:'Santiago Montero'},
{val:'johnnyhalife', meta:'Johnny Halife'},
{val:'arielflesler', meta:'Ariel Flesler'},
{val:'rbajales', meta:'Raul Bajales'}];
var customItemTemplate = "<div><span />&nbsp;<small /></div>";
function elementFactory(element, e) {
var template = $(customItemTemplate).find('span')
.text('@' + e.val).end()
.find('small')
.text("(" + e.meta + ")").end();
element.append(template);
};
alert(JSON.stringify($("textarea")));
// here is how we use it
$('textarea').sew({values: values, elementFactory: elementFactory});
});
Was it helpful?

Solution 2

try this one too:

http://www.hawkee.com/snippet/9391/

$('#inputbox').triggeredAutocomplete({
    hidden: '#hidden_inputbox',
    source: "/search.php",
    trigger: "@" 
});

OTHER TIPS

your question is not clear you can try this example

    var src = [{val:'santiagotactivos', meta:'Santiago Montero'},
{val:'johnnyhalife', meta:'Johnny Halife'},
{val:'arielflesler', meta:'Ariel Flesler'},
{val:'rbajales', meta:'Raul Bajales'}];

    $("#auto").autocomplete({ 
        source:src
    });
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top