开发者

is there any way to overwrite select event?

i'm using jquery ui auto-complete i would like the reuslts to not insert into input but to go to pa开发者_StackOverflowge that link it if that make any sense


just write your own function inside the select property of autocomplete to redirect

select: function( event, ui )
{
   location.href = ui.item.link;
   return false;
}

you have to set a field representing the link where to redirect in your json result. On the example above link.

Json ouptut would be:

{
   "label" : "your_label",
   "value" : "your_value",
   "link"  : "your_link"
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜