-
Notifications
You must be signed in to change notification settings - Fork 11
/
form_autocomplete.html
668 lines (633 loc) · 36.4 KB
/
form_autocomplete.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>网豫游戏 | 搜索自动补全</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="font-awesome/css/font-awesome.css" rel="stylesheet">
<link href="css/animate.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<div id="wrapper">
<nav class="navbar-default navbar-static-side" role="navigation">
<div class="sidebar-collapse">
<ul class="nav metismenu" id="side-menu">
<li class="nav-header">
<div class="dropdown profile-element"> <span>
<img alt="image" class="img-circle" src="img/profile_small.jpg" />
</span>
<a data-toggle="dropdown" class="dropdown-toggle" href="#">
<span class="clear"> <span class="block m-t-xs"> <strong class="font-bold">王宇</strong>
</span> <span class="text-muted text-xs block">管理员 <b class="caret"></b></span> </span> </a>
<ul class="dropdown-menu animated fadeInRight m-t-xs">
<li><a href="profile.html">个人信息</a></li>
<li><a href="contacts.html">好友</a></li>
<li><a href="mailbox.html">信箱</a></li>
<li class="divider"></li>
<li><a href="login.html">登出</a></li>
</ul>
</div>
<div class="logo-element">
IN+
</div>
</li>
<li>
<a href="index.html"><i class="fa fa-th-large"></i> <span class="nav-label">主页</span> <span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="index.html">主页示例 v.1</a></li>
<li><a href="dashboard_2.html">主页示例 v.2</a></li>
<li><a href="dashboard_3.html">主页示例 v.3</a></li>
<li><a href="dashboard_4_1.html">主页示例 v.4</a></li>
<li><a href="dashboard_5.html">主页示例 v.5 </a></li>
</ul>
</li>
<li>
<a href="layouts.html"><i class="fa fa-diamond"></i> <span class="nav-label">布局</span></a>
</li>
<li>
<a href="#"><i class="fa fa-bar-chart-o"></i> <span class="nav-label">图表</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level collapse">
<li><a href="graph_flot.html">Flot</a></li>
<li><a href="graph_morris.html">Morris</a></li>
<li><a href="graph_rickshaw.html">Rickshaw</a></li>
<li><a href="graph_chartjs.html">Chart</a></li>
<li><a href="graph_chartist.html">Chartist</a></li>
<li><a href="c3.html">C3</a></li>
<li><a href="graph_peity.html">Peity</a></li>
<li><a href="graph_sparkline.html">Sparkline</a></li>
</ul>
</li>
<li>
<a href="mailbox.html"><i class="fa fa-envelope"></i> <span class="nav-label">邮箱 </span><span class="label label-warning pull-right">16/24</span></a>
<ul class="nav nav-second-level collapse">
<li><a href="mailbox.html">收件箱</a></li>
<li><a href="mail_detail.html">邮件内容</a></li>
<li><a href="mail_compose.html">撰写邮件</a></li>
<li><a href="email_template.html">邮件模板</a></li>
</ul>
</li>
<li>
<a href="metrics.html"><i class="fa fa-pie-chart"></i> <span class="nav-label">指标</span> </a>
</li>
<li>
<a href="widgets.html"><i class="fa fa-flask"></i> <span class="nav-label">窗口小部件</span></a>
</li>
<li class="active">
<a href="#"><i class="fa fa-edit"></i> <span class="nav-label">表单</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level collapse">
<li><a href="form_basic.html">基本表单</a></li>
<li><a href="form_advanced.html">高级表单</a></li>
<li><a href="form_wizard.html">表单向导</a></li>
<li><a href="form_file_upload.html">文件上传</a></li>
<li><a href="form_editors.html">编辑器</a></li>
<li class="active"><a href="form_autocomplete.html">搜索自动补全</a></li>
<li><a href="form_markdown.html">Markdown编辑器</a></li>
</ul>
</li>
<li>
<a href="#"><i class="fa fa-desktop"></i> <span class="nav-label">应用</span> <span class="pull-right label label-primary">特别</span></a>
<ul class="nav nav-second-level collapse">
<li><a href="contacts.html">名片</a></li>
<li><a href="profile.html">会员</a></li>
<li><a href="profile_2.html">会员 v.2</a></li>
<li><a href="contacts_2.html">联系人 v.2</a></li>
<li><a href="projects.html">项目</a></li>
<li><a href="project_detail.html">项目详情</a></li>
<li><a href="activity_stream.html">活动</a></li>
<li><a href="teams_board.html">团队</a></li>
<li><a href="social_feed.html">社交</a></li>
<li><a href="clients.html">客户端</a></li>
<li><a href="full_height.html">Outlook视图</a></li>
<li><a href="vote_list.html">投票</a></li>
<li><a href="file_manager.html">文件管理器</a></li>
<li><a href="calendar.html">日历</a></li>
<li><a href="issue_tracker.html">问题</a></li>
<li><a href="blog.html">博客</a></li>
<li><a href="article.html">文章</a></li>
<li><a href="faq.html">帮助</a></li>
<li><a href="timeline.html">时间轴</a></li>
<li><a href="pin_board.html">便签</a></li>
</ul>
</li>
<li>
<a href="#"><i class="fa fa-files-o"></i> <span class="nav-label">页面</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level collapse">
<li><a href="search_results.html">搜索</a></li>
<li><a href="lockscreen.html">锁屏</a></li>
<li><a href="invoice.html">发票</a></li>
<li><a href="login.html">登录</a></li>
<li><a href="login_two_columns.html">登录 v.2</a></li>
<li><a href="forgot_password.html">忘记密码</a></li>
<li><a href="register.html">注册</a></li>
<li><a href="404.html">404页</a></li>
<li><a href="500.html">500页</a></li>
<li><a href="empty_page.html">空白页</a></li>
</ul>
</li>
<li>
<a href="#"><i class="fa fa-globe"></i> <span class="nav-label">组件</span><span class="label label-info pull-right">新</span></a>
<ul class="nav nav-second-level collapse">
<li><a href="toastr_notifications.html">Toastr通知</a></li>
<li><a href="nestable_list.html">拖动排序</a></li>
<li><a href="agile_board.html">Agile board</a></li>
<li><a href="timeline_2.html">时间轴 v.2</a></li>
<li><a href="diff.html">Diff</a></li>
<li><a href="pdf_viewer.html">PDF 查看器</a></li>
<li><a href="i18support.html">i18 support</a></li>
<li><a href="sweetalert.html">弹层组件</a></li>
<li><a href="idle_timer.html">空闲计时器</a></li>
<li><a href="truncate.html">截断字符串</a></li>
<li><a href="password_meter.html">密码</a></li>
<li><a href="spinners.html">加载动画</a></li>
<li><a href="spinners_usage.html">Spinners usage</a></li>
<li><a href="tinycon.html">Live favicon</a></li>
<li><a href="google_maps.html">谷歌地图</a></li>
<li><a href="datamaps.html">数据地图</a></li>
<li><a href="social_buttons.html">社交按钮</a></li>
<li><a href="code_editor.html">代码编辑器</a></li>
<li><a href="modal_window.html">模态窗口</a></li>
<li><a href="clipboard.html">文本剪贴板</a></li>
<li><a href="text_spinners.html">Text spinners</a></li>
<li><a href="forum_main.html">论坛</a></li>
<li><a href="validation.html">验证</a></li>
<li><a href="tree_view.html">树形菜单</a></li>
<li><a href="loading_buttons.html">加载按钮</a></li>
<li><a href="chat_view.html">聊天视窗</a></li>
<li><a href="masonry.html">瀑布流布局</a></li>
<li><a href="tour.html">新手指引</a></li>
</ul>
</li>
<li>
<a href="#"><i class="fa fa-flask"></i> <span class="nav-label">UI元素</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level collapse">
<li><a href="typography.html">排版</a></li>
<li><a href="icons.html">图标</a></li>
<li><a href="draggable_panels.html">拖动排序</a></li>
<li><a href="resizeable_panels.html">内容缩放</a></li>
<li><a href="buttons.html">按钮</a></li>
<li><a href="video.html">视频</a></li>
<li><a href="tabs_panels.html">面板</a></li>
<li><a href="tabs.html">标签</a></li>
<li><a href="notifications.html">通知 & 工具</a></li>
<li><a href="helper_classes.html">CSS辅助</a></li>
<li><a href="badges_labels.html">徽章 & 标签 & 进度条</a></li>
</ul>
</li>
<li>
<a href="grid_options.html"><i class="fa fa-laptop"></i> <span class="nav-label">栅格</span></a>
</li>
<li>
<a href="#"><i class="fa fa-table"></i> <span class="nav-label">表格</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level collapse">
<li><a href="table_basic.html">静态表格</a></li>
<li><a href="table_data_tables.html">数据表格</a></li>
<li><a href="table_foo_table.html">Foo表格</a></li>
<li><a href="jq_grid.html">jqGrid</a></li>
</ul>
</li>
<li>
<a href="#"><i class="fa fa-shopping-cart"></i> <span class="nav-label">商城</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level collapse">
<li><a href="ecommerce_products_grid.html">产品图表</a></li>
<li><a href="ecommerce_product_list.html">产品列表</a></li>
<li><a href="ecommerce_product.html">产品编辑</a></li>
<li><a href="ecommerce_product_detail.html">产品详情</a></li>
<li><a href="ecommerce-cart.html">购物车</a></li>
<li><a href="ecommerce-orders.html">订购页</a></li>
<li><a href="ecommerce_payments.html">支付页</a></li>
</ul>
</li>
<li>
<a href="#"><i class="fa fa-picture-o"></i> <span class="nav-label">相册</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level collapse">
<li><a href="basic_gallery.html">基本图库</a></li>
<li><a href="slick_carousel.html">图片切换</a></li>
<li><a href="carousel.html">Bootstrap相册</a></li>
</ul>
</li>
<li>
<a href="#"><i class="fa fa-sitemap"></i> <span class="nav-label">菜单 </span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level collapse">
<li>
<a href="#" id="damian">二级菜单1 <span class="fa arrow"></span></a>
<ul class="nav nav-third-level">
<li>
<a href="#">三级菜单1</a>
</li>
<li>
<a href="#">三级菜单2</a>
</li>
<li>
<a href="#">三级菜单3</a>
</li>
</ul>
</li>
<li><a href="#">二级菜单2</a></li>
<li>
<a href="#">二级菜单3</a></li>
<li>
<a href="#">二级菜单4</a></li>
</ul>
</li>
<li>
<a href="css_animation.html"><i class="fa fa-magic"></i> <span class="nav-label">CSS动画 </span><span class="label label-info pull-right">62</span></a>
</li>
<li class="landing_link">
<a target="_blank" href="landing.html"><i class="fa fa-star"></i> <span class="nav-label">登录</span> <span class="label label-warning pull-right">新</span></a>
</li>
<li class="special_link">
<a href="package.html"><i class="fa fa-database"></i> <span class="nav-label">组件</span></a>
</li>
</ul>
</div>
</nav>
<div id="page-wrapper" class="gray-bg">
<div class="row border-bottom">
<nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
<div class="navbar-header">
<a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i> </a>
<form role="search" class="navbar-form-custom" action="search_results.html">
<div class="form-group">
<input type="text" placeholder="请输入搜索内容" class="form-control" name="top-search" id="top-search">
</div>
</form>
</div>
<ul class="nav navbar-top-links navbar-right">
<li>
<span class="m-r-sm text-muted welcome-message">欢迎来到网豫游戏管理后台</span>
</li>
<li class="dropdown">
<a class="dropdown-toggle count-info" data-toggle="dropdown" href="#">
<i class="fa fa-envelope"></i> <span class="label label-warning">16</span>
</a>
<ul class="dropdown-menu dropdown-messages">
<li>
<div class="dropdown-messages-box">
<a href="profile.html" class="pull-left">
<img alt="image" class="img-circle" src="img/a7.jpg">
</a>
<div class="media-body">
<small class="pull-right">46小时前</small>
<strong>小明</strong> 评论了 <strong>小红</strong>. <br>
<small class="text-muted">2017.10.06 7:58</small>
</div>
</div>
</li>
<li class="divider"></li>
<li>
<div class="dropdown-messages-box">
<a href="profile.html" class="pull-left">
<img alt="image" class="img-circle" src="img/a4.jpg">
</a>
<div class="media-body ">
<small class="pull-right text-navy">5小时前</small>
<strong>小红</strong> 打电话给了 <strong>小黑</strong>. <br>
<small class="text-muted">2017.10.06 7:58</small>
</div>
</div>
</li>
<li class="divider"></li>
<li>
<div class="dropdown-messages-box">
<a href="profile.html" class="pull-left">
<img alt="image" class="img-circle" src="img/profile.jpg">
</a>
<div class="media-body ">
<small class="pull-right">23小时前</small>
<strong>小黑</strong> 点赞了 <strong>小红</strong>. <br>
<small class="text-muted">2017.10.06 7:58</small>
</div>
</div>
</li>
<li class="divider"></li>
<li>
<div class="text-center link-block">
<a href="mailbox.html">
<i class="fa fa-envelope"></i> <strong>阅读所有消息</strong>
</a>
</div>
</li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle count-info" data-toggle="dropdown" href="#">
<i class="fa fa-bell"></i> <span class="label label-primary">8</span>
</a>
<ul class="dropdown-menu dropdown-alerts">
<li>
<a href="mailbox.html">
<div>
<i class="fa fa-envelope fa-fw"></i> 你有16条消息
<span class="pull-right text-muted small">4 分钟前</span>
</div>
</a>
</li>
<li class="divider"></li>
<li>
<a href="profile.html">
<div>
<i class="fa fa-twitter fa-fw"></i> 3 个新的关注者
<span class="pull-right text-muted small">12 分钟前</span>
</div>
</a>
</li>
<li class="divider"></li>
<li>
<a href="grid_options.html">
<div>
<i class="fa fa-upload fa-fw"></i> 重启服务器
<span class="pull-right text-muted small">4 分钟前</span>
</div>
</a>
</li>
<li class="divider"></li>
<li>
<div class="text-center link-block">
<a href="notifications.html">
<strong>查看所有信息</strong>
<i class="fa fa-angle-right"></i>
</a>
</div>
</li>
</ul>
</li>
<li>
<a href="login.html">
<i class="fa fa-sign-out"></i> 注销
</a>
</li>
</ul>
</nav>
</div>
<div class="row wrapper border-bottom white-bg page-heading">
<div class="col-lg-10">
<h2>搜索自动补全</h2>
<ol class="breadcrumb">
<li>
<a href="index.html">主页</a>
</li>
<li>
<a>表单</a>
</li>
<li class="active">
<strong>搜索自动补全</strong>
</li>
</ol>
</div>
<div class="col-lg-2">
</div>
</div>
<div class="wrapper wrapper-content animated fadeIn">
<div class="row">
<div class="col-lg-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>搜索自动完成 - Bootstrap预输入</h5>
<div class="ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>
</a>
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<i class="fa fa-wrench"></i>
</a>
<ul class="dropdown-menu dropdown-user">
<li><a href="#">选项 1</a>
</li>
<li><a href="#">选项 2</a>
</li>
</ul>
<a class="close-link">
<i class="fa fa-times"></i>
</a>
</div>
</div>
<div class="ibox-content">
<strong>搜索自动完成 - 预输入</strong><br/>
来自Twitter的Bootstrap 2的Typeahead插件可以使用Bootstrap 3和Bootstrap 4.完整的文档可以找到: <a href="https://github.com/bassjobsen/Bootstrap-3-Typeahead" target="_blank">https://github.com/bassjobsen/Bootstrap-3-Typeahead</a>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>基本示例 - 数据*</h5>
</div>
<div class="ibox-content">
<p>
通过数据属性的基本示例: <span class="text-muted">(type 'item...')</span>
</p>
<input type="text" placeholder="item..." data-provide="typeahead" data-source='["item 1","item 2","item 3"]' class="form-control" />
<pre class="m-t-sm">
<input type="text"
data-provide="typeahead"
data-source='["item 1","item 2","item 3"]'
placeholder="item..."
class="form-control" /></pre>
</div>
</div>
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>加载收藏</h5>
</div>
<div class="ibox-content">
<p>
从json文件加载收集 <span class="text-muted">(type 'Arg...')</span>
</p>
<input type="text" placeholder="item..." class="typeahead_2 form-control" />
<pre class="m-t-sm">
$.get('js/api/typehead_collection.json', function(data){
$(".typeahead_2").typeahead({ source:data.countries });
},'json'); </pre>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>基本示例 - javascript</h5>
</div>
<div class="ibox-content">
<p>
基本的例子通过javascript <span class="text-muted">(type 'item...')</span>
</p>
<input type="text" placeholder="item..." class="typeahead_1 form-control" />
<pre class="m-t-sm">
$('.typeahead_1').typeahead({
source: ["item 1","item 2","item 3"]
}); </pre>
</div>
</div>
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>加载更复杂的对象</h5>
</div>
<div class="ibox-content">
<p>
加载json对象 - 必需的'name'属性 <span class="text-muted">(type 'Afg...')</span>
</p>
<input type="text" placeholder="item..." class="typeahead_3 form-control" />
<pre class="m-t-sm">
$('.typeahead_3').typeahead({
source: [
{"name": "Afghanistan", "code": "AF", "ccn0": "040"},
{"name": "Land Islands", "code": "AX", "ccn0": "050"},
{"name": "Albania", "code": "AL","ccn0": "060"},
{"name": "Algeria", "code": "DZ","ccn0": "070"}
]
}); </pre>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>选项</h5>
</div>
<div class="ibox-content">
<p>可以通过数据属性或JavaScript传递选项。 对于数据属性,将选项名称附加到 <code>data-</code>, 如同 <code>data-source=""</code>.</p>
<table class="table">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>默认</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>source</td>
<td>array, function</td>
<td>[ ]</td>
<td>要查询的数据源。可能是一个字符串数组,一个具有name属性或函数的JSON对象数组。该函数接受两个参数, <code>query</code> 即输入字段中的值和 <code>process</code> 回调。该函数可以通过 <code>process</code> 回调的单个参数直接或异步返回数据源来同步使用。</td>
</tr>
<tr>
<td>items</td>
<td>number</td>
<td>8</td>
<td>在下拉列表中显示的最大项目数。也可以设置为“全部”</td>
</tr>
<tr>
<td>minLength</td>
<td>number</td>
<td>1</td>
<td>触发自动填充建议之前所需的最小字符长度。您可以将其设置为0,因此即使在调用查找功能时没有文本时也会显示建议。</td>
</tr>
<tr>
<td>showHintOnFocus</td>
<td>boolean</td>
<td>false</td>
<td>一旦输入得到焦点,就可以在适用时显示提示。</td>
</tr>
<tr>
<td>scrollHeight</td>
<td>number, function</td>
<td>0</td>
<td>可滚动父容器向下滚动的像素数(滚出视口)。</td>
</tr>
<tr>
<td>matcher</td>
<td>function</td>
<td>case insensitive</td>
<td>用于确定查询是否匹配项的方法。接受单个参数, <code>item</code> 用于测试查询。访问当前查询 <code>this.query</code>。<code>true</code>如果查询是匹配,则返回一个布尔值。</td>
</tr>
<tr>
<td>sorter</td>
<td>function</td>
<td>exact match,<br> case sensitive,<br> case insensitive</td>
<td>用于对自动完成结果进行排序的方法。接受单个参数, <code>items</code> 并具有类型头实例的范围。引用当前查询 <code>this.query</code>.</td>
</tr>
<tr>
<td>updater</td>
<td>function</td>
<td>returns selected item</td>
<td>用于返回所选项目的方法。接受单个参数, <code>item</code> 并具有类型头实例的范围。</td>
</tr>
<tr>
<td>highlighter</td>
<td>function</td>
<td>highlights all default matches</td>
<td>用于突出显示自动完成结果的方法。接受单个参数, <code>item</code> 并具有类型头实例的范围。应该返回html</td>
</tr>
<tr>
<td>displayText</td>
<td>function</td>
<td>item.name || item</td>
<td>用于获取源的项目的文本表示的方法。接受单个参数, <code>item</code> 并具有类型头实例的范围。应该返回一个String。</td>
</tr>
<tr>
<td>autoSelect</td>
<td>boolean</td>
<td>true</td>
<td>允许您指定是否自动选择第一个建议。关闭自动选择也意味着如果没有选择 <kbd>enter</kbd> 或被 <kbd>tab</kbd> 击中,输入将不会被清除。</td>
</tr>
<tr>
<td>afterSelect</td>
<td>function</td>
<td>$.noop()</td>
<td>调用功能在选择一个项目后执行。它将当前活动项目置于参数中(如果有)。</td>
</tr>
<tr>
<td>delay</td>
<td>integer</td>
<td>0</td>
<td>在查找之间增加延迟。</td>
</tr>
<tr>
</tr><tr>
<td>addItem</td>
<td>JSON object</td>
<td>false</td>
<td>将项目添加到列表的末尾,例如“新建条目”。例如,当在数据列表中找不到某个项目时,可以使用该对话框。示例: <a href="http://cl.ly/image/2u170I1q1G3A/addItem.png">http://cl.ly/image/2u170I1q1G3A/addItem.png</a></td>
</tr></tbody>
</table>
</div>
</div>
</div>
</div>
<div class="footer">
<div class="pull-right">
<strong>www.108wan.com</strong>
</div>
<div>
<strong>Copyright</strong> 网豫游戏 © 2017-2018
</div>
</div>
</div>
</div>
<!-- Mainly scripts -->
<script src="js/jquery-3.1.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<!-- Custom and plugin javascript -->
<script src="js/inspinia.js"></script>
<script src="js/plugins/pace/pace.min.js"></script>
<!-- Typehead -->
<script src="js/plugins/typehead/bootstrap3-typeahead.min.js"></script>
<script>
$(document).ready(function(){
$('.typeahead_1').typeahead({
source: ["item 1","item 2","item 3"]
});
$.get('js/api/typehead_collection.json', function(data){
$(".typeahead_2").typeahead({ source:data.countries });
},'json');
$('.typeahead_3').typeahead({
source: [
{"name": "Afghanistan", "code": "AF", "ccn0": "040"},
{"name": "Land Islands", "code": "AX", "ccn0": "050"},
{"name": "Albania", "code": "AL","ccn0": "060"},
{"name": "Algeria", "code": "DZ","ccn0": "070"}
]
});
});
</script>
</body>
</html>