| Autor | Zpráva | ||
|---|---|---|---|
| Petr1 Profil * |
#1 · Zasláno: 27. 10. 2012, 20:43:06
Zdravím,
zkouším v jquery autocomplete http://jqueryui.com/autocomplete/#categories vytvořit přesměrování na určitou url. Zkoušel jsem příkládek zde http://nimpkish.com/blog/jquery-autocomplete-and-data-set a potom nějaké co vyhledal Google, ale bez úspěchu. Jako základ mám následující: <script>
$.widget( "custom.catcomplete", $.ui.autocomplete, {
_renderMenu: function( ul, items ) {
var that = this,
currentCategory = "";
$.each( items, function( index, item ) {
if ( item.category != currentCategory ) {
ul.append( "<li class='ui-autocomplete-category'>" + item.category + "</li>" );
currentCategory = item.category;
}
that._renderItemData( ul, item );
});
}
});
</script>
<script>
$(function() {
var data = [
{ label: "anders", category: "" },
{ label: "andreas", category: "" },
{ label: "antal", category: "" },
{ label: "annhhx10", category: "Products" },
{ label: "annk K12", category: "Products" },
{ label: "annttop C13", category: "Products" },
{ label: "anders andersson", category: "People" },
{ label: "andreas andersson", category: "People" },
{ label: "andreas johnson", category: "People" }
];
$( "#search" ).catcomplete({
delay: 0,
source: data
});
});
</script>
</head>
<body>
<label for="search">Search: </label>
<input id="search" />Dokázal by mi někdo dosadit automatické přesměrování na stránku, kterou bych definoval např. takto: { label: "annhhx10", category: "Products", url: "http://www.example.tld/produkt-jedna" },Děkuji. |
||
|
Časová prodleva: 14 let
|
|||
0