|
List Info
Thread: How to write an AutoComplete Schema for Json?
|
|
| How to write an AutoComplete Schema for
Json? |

|
2006-09-15 10:27:41 |
|
|
Hi, greetings!
I have a JSON data structure like this:
==============================
[
{
"eid":"1520199",
"keyword":"hello",
"definition":"h?¨Alo,h?¨Alo;h?¨ lou,he¨ lou< hel.lo >\n[³£ÓÃ×Ö]\n(Ò²×÷
hul.lo)\n<<¸Ð̾´Ê>>\nι! ¹þÃÞ!\nÓÃì¶Îʺò¡¢½Óµç»°¼°±í´ï¾ªÑÈ\n<<Ãû´Ê>>\npl.
hellos\n"hello" µÄºôÉù¼°ÎʺòÓï\n<<²»¼°Îﶯ´Ê>>\nhelloed, hello.ing, helloes\n˵
"hello"\r\n",
"bookid":"2"
},
{
"eid":"1520200",
"keyword":"hello
girl",
"definition":"< hello
girl >\n<<Ãû´Ê>>\nÅ®½ÓÏßÉú\r\n","bookid":"2"
}
]
===============
and i have tried to code a Data Source like
"
SAutoCompDataSource= new
YAHOO.widget.DS_XHR("pdict-backend.php", ["", "keyword",
"definition", "eid"]); SAutoCompDataSource.queryMatchContains
= true; SAutoCompDataSource.responseType =
SAutoCompDataSource.TYPE_JSON; SAutoCompDataSource.scriptQueryAppend =
"action=SearchAutoComp"; SAutoCompDataSource.maxCacheEntries = 0;
var SearchAutoComp=new
YAHOO.widget.AutoComplete("tfSearchWord","dvAutoComplete",
SAutoCompDataSource); // Container will expand and collapse
vertically SearchAutoComp.animVert = true;
// Container will expand and collapse
horizontally SearchAutoComp.animHoriz = true;
// Container animation will take 2 seconds to
complete SearchAutoComp.animSpeed = 1;
// ...or disable query delimiters altogether
(default) SearchAutoComp.delimChar = "";
// Display up to 20 results in the
container SearchAutoComp.maxResultsDisplayed = 10; // Require user to type
at least 3 characters before triggering a query SearchAutoComp.minQueryLength
=2; SearchAutoComp.queryDelay = 1; SearchAutoComp.highlightClassName =
"clsSAutoCompHighlight"; SearchAutoComp.prehighlightClassName =
"clsSAutoCompPreHighlight"; SearchAutoComp.useShadow = true;
SearchAutoComp.typeAhead = true; SearchAutoComp.allowBrowserAutocomplete
= false;
"
=======
since my data contains no "N-depth.object.notation.to.each.result" as the documentation
tells, i dont know how to make the entire thing working, especially with the
Schema part.
please help me ..
= = = = = = = = = = = = = = = = = = = = = =
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Ö Àñ£¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡[CN]Yi-Mu-Ke-IMKOW
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2006-09-15
__._,_.___
__,_._,___
|
[1]
|
|
|
about | contact Other archives ( Real Estate discussion Medical topics )
|