Einstellen ausgewählten Wert von typeahead

Ich bin mit dem twitter bootstrap typeahead.

Habe ich angepasst typehead, so kann ich wählen Sie ein paar Wert/label

$.each(data.medicines,function(index,values){

    _med=new Object()
    _med.value=values.LYF
    _med.id=values.LYF_NUMER
    _medicines.push(_med)

})

//Fill typeahead with data
$('.typeahead').typeahead({
    //note that "value" is the default setting for the property option
    source:_medicines,
    onselect: function(obj) { showdetails(obj) }
})

Wie kann ich den ausgewählten Wert mit Javascript ?

For exemple $("#mytypehead").val(43);
  • Warum ist dies mit einer -1 ?
InformationsquelleAutor gpasse | 2013-06-24
Schreibe einen Kommentar