updated demo page

This commit is contained in:
2010-03-15 13:49:00 +02:00
parent 01e7282f2f
commit 1f7899e21e
2 changed files with 16 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
var data = [
var exampleData = [
{"title": "Ädams, Egbert", "info": "Bedfordshire", "href": "/demo/user/1", "match": "zzzz"},
{"title": "Altman, Alisha", "info": "Buckinghamshire", "href": "/demo/user/2", "match": "zzzz"},
{"title": "Archibald, Janna", "info": "Cambridgeshire", "href": "/demo/user/3", "match": "zzzz"},

View File

@@ -19,19 +19,26 @@
$(document).ready(function(){
$("#example1").suggest_results({
data: data
data: exampleData
});
$("#example2").suggest_results({
url: "server-side.php"
url: "server-side.php",
});
$("#example3").suggest_results({
url: "server-side.php",
name: "example3",
empty: false,
no_results: false,
limit: 4,
tpl_result_body: '<span class="title">{{title}}</span><span class="info">{{info}}</span>'
tpl_result_body: '<span class="title">{{title}}</span><span class="info">{{ info }}</span>'
});
$("#example4").suggest_results({
data: exampleData,
pos_top: 0,
pos_left: 20,
width: 168
});
});
@@ -68,6 +75,10 @@
<strong>Customized results from ajax call:</strong><br />
<input type="text" name="example3" value="" id="example3" />
</p>
<p>
<strong>Customized position with results from local array:</strong><br />
<input type="text" name="example4" value="" id="example4" />
</p>
<p>
<a href="http://github.com/jimeh/suggest_results">GitHub Project Page</a>
</p>