English 中文(简体)
jquery autocomplete - Defining the list
原标题:jquery autocomplete - defining the list

我正试图使用一个简单的自动清单,列出用户名单(约500)。

  1. I see that it s possible to call to some file (i.e. php,ashx) that contain the requested list. what is this file? how should look the list? where can i find additional data?

  2. Alternativily (my prefered choice) I can use a fixed list in: From devbridge code: lookup: [ January , February , March , April , May ]

    jquery-代码:source: [“c++”、“java”、“php”、“coldfusion”、“javascript”、“asp”、“ruby”]

    but the problem is how to set this array not hardcoded - I tried: var arr1 = [ January , Jania , February , March , April , May ]; var arr2 = []; for(var i=0;i<all_analysts.length;i++){ arr[i] = all_analysts[i]; alert(arr[i]);//////// } lookup: arr2 //local lookup values

    but only when using hardcoded:lookup: [ January , February , March , April , May ] it works.

请你协助?

感谢!

问题回答

关于您的第1 问题,请看这个例子:

As you can see, if source option is a string it is treated as url to which the ajax request will be made in order to get the list of data matching term inputed by user. Given url should return data in JSON format.

举例来说,如果你将提出“/确定”用户的源选择。 一旦用户将“mo”投入到投入领域,汽车植被就会提出亚克斯要求,以接下去:“/确定用户?term=mo”。 一旦用户输入另一封信(小册子说其“r”),将再次请求使用:“/find_users?term=mor”。

通知term查询变量,其中载有用户在你的网页上输入的现值。

关于<<>秒的问题——在你的代码中有打字面——你(因为我不清楚)把所有电线的数值都列入arr变量,然后将arr2作为lookup参数值。 例arr2 这是一种空洞的阵e,因此按预期起作用。





相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签