deben pasarle exactamente el string al data-source... usando las comillas y 
corchetes...

es decir deben hacer algo así --> 

var a = '["caracas","venezuela","peru"]';

$('#ac-venue-name').typeahead({
          source: a
        });


o tambien pueden hacer asi -->

var a = '["caracas","venezuela","peru"]';
$('#ac-venue-name').attr('data-source', a );

On Friday, August 31, 2012 2:47:32 PM UTC-4:30, jmesserer wrote:
>
> Can someone help me out ... I'm not seeing the typeahead behavior in the 
> following example (see attached file):
>
>     <script>
>       //<![CDATA[
>         var a = ['venue 1', 'venue 1.5', 'venue 2', 'venue 3', 'venue 4', 
> 'venue 5'];
>         
>         $('#ac-venue-name').typeahead({
>           source: a
>         });
>       //]]>
>     </script>
>     <input id="ac-venue-name" type="text" />
>
> I am loading jquery and bootstrap js prior to attempting this.
>
> Thanks,
>
> J
>
> On Monday, July 16, 2012 12:05:03 PM UTC-5, Ivan Vergiliev wrote:
>>
>> The question is a bit old, but just in case anyone needs an answer:
>>
>> Bootstrap typeahead expects all data to come from the same place - so if 
>> you have data-provide="typeahead", you also have to specify 
>> data-source="[...]" and any other options you need. In case you want to 
>> activate the typeahead in Javascript, just lose the 
>> 'data-provide="typeahead"' and it should work.
>>
>> 26 февруари 2012, неделя, 13:02:05 UTC+2, Anuar Balgimbayev написа:
>>>
>>> hello guys!
>>> bootstrap's typeahead doesn't work in my hands. 
>>>
>>> <script type="text/javascript" 
>>> src="/bootstrap/js/bootstrap-typeahead.js"></script> (from git)
>>>
>>> <script type="text/javascript">
>>>             var mas = ['Red', 'Green', 'Blue];
>>>             
>>>             $('.typeahead').typeahead({
>>>                  source: mas
>>>             })
>>> </script>
>>>
>>> <td>
>>>   <div>
>>>        <input type="text" name="searchWord" style="width: 130px" 
>>> placeholder="search" data-provide="typeahead"  />
>>>   </div>
>>> </td>
>>>
>>> what i'm doing wrong?
>>> thanks for any suggestions
>>>
>>>

Reply via email to