twitter bootstrap önerileri ajax örneği | Netgez.com
SORU
10 ÅžUBAT 2012, Cuma


twitter bootstrap önerileri ajax örneği

Bir ajax çağrısı açılan doldurmak için yapacak twitter bootstrap typeahead eleman Çalışma bir örnek bulmaya çalışıyorum.

Ajax url tanımlayan ve cevap işlemi nasıl örnek otomatik tamamlama mevcut bir çalışma bir WordPress kullanmak zorundayım

<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
    var options = { minChars:3, max:20 };
    $("#runnerquery").autocomplete('./index/runnerfilter/format/html',options).result(
            function(event, data, formatted)
                {
                    window.location = "./runner/index/id/" data[1];
                }
            );
       ..

Ben önerileri örnek dönüştürmek, değiştirmek gerekir?

<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
    var options = { source:'/index/runnerfilter/format/html', items:5 };
    $("#runnerquery").typeahead(options).result(
            function(event, data, formatted)
                {
                    window.location = "./runner/index/id/" data[1];
                }
            );
       ..

'Add remote sources support for typeahead' çözülmesi gereken sorun için bekleyeceğim

CEVAP
23 AÄžUSTOS 2012, PERÅžEMBE


Edit: önerileri artık Bootstrap 3 paket halinde gelir. Check out:

Bootstrap 2.1.0 2.3.2, size bağlı olarak yapabileceği bu

$('.typeahead').typeahead({
    source: function (query, process) {
        return $.get('/typeahead', { query: query }, function (data) {
            return process(data.options);
        });
    }
});

JSON veri tüketmek gibi:

{
    "options": [
        "Option 1",
        "Option 2",
        "Option 3",
        "Option 4",
        "Option 5"
    ]
}

JSON verileri JSON olarak tanıdığı bir WordPress kullanmak çok doğru mıme türü (application/json) olması gerektiğini unutmayın.

Bunu PaylaÅŸ:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • ★ByScrapi★ Designs

    ★ByScrapiâ

    27 AÄžUSTOS 2013
  • Study with Substance P

    Study with S

    31 Mayıs 2008
  • xXGAMERrs_Xx

    xXGAMERrs_Xx

    31 Temmuz 2014