Loading ...
Sorry, an error occurred while loading the content.

答复: [ydn-javascript] There is a yui 2. 6.0 autocomplete problem(with json)

Expand Messages
  • Zhang Jie \(��杰 BSH\)
    Successed!! I got it !! I should set oDS.responseType = YAHOO.util.XHRDataSource.TYPE_json . not text .. Finally ! welcome to china ..even after Olympic
    Message 1 of 1 , Oct 9, 2008
    • 0 Attachment

      Successed!!  I got it !!    I should set oDS.responseType = YAHOO.util.XHRDataSource.TYPE_json .  not text ..

       

      Finally ! welcome to china ..even after Olympic Games

       

      发件人: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] 代表 Zhang Jie (��杰 BSH)
      发送时间: 20081010 14:01
      收件人: ydn-javascript@yahoogroups.com
      主题: [ydn-javascript] There is a yui 2.6.0 autocomplete problem(with json)

       

       HELLO EVERYONE,

       

      Now, I use autocomplete  with yui2.6.0  ,I found there are different with yui 2.5.1, I cant use json  datasource.

       

      The json data is as below:

       

      {"Product": [{"id":102,"ProductName":"\u81F3\u5C0A9000"},{"id":98,"ProductName":"\u725B\u6D25\u5168\u80FD\u738B Super7000"},{"id":99,"ProductName":"\u725B\u6D25\u5168\u80FD\u738B Super5000"},{"id":94,"ProductName":"Hello Kitty \u68A6\u5E7B\u5929\u4F7F\u7248"},{"id":70,"ProductName":"Hello Kitty \u725B\u6D25\u68A6\u5E7B\u7248"},{"id":49,"ProductName":"Hello Kitty \u725B\u6D25\u5E78\u8FD0\u7248"},{"id":51,"ProductName":"Hello Kitty \u725B\u6D25\u771F\u7231\u7248"},{"id":50,"ProductName":"\u5E7E\u7C73\u725B\u6D25\u73CD\u85CF\u7248"},{"id":61,"ProductName":"Mickey Mouse MK101"},{"id":78,"ProductName":"Hello Kitty \u6570\u7801\u76F8\u673A DC-520"},{"id":79,"ProductName":"Hello Kitty \u6570\u7801\u76F8\u673A DC-1020"},{"id":80,"ProductName":"Hello Kitty \u6570\u7801\u76F8\u673A DC-1240"},{"id":100,"ProductName":"Hello Kitty 2008\u6C38\u6052\u7248"},{"id":73,"ProductName":"\u725B\u6D25\u5BB6\u6559\u738BV1"},{"id":86,"ProductName":"\u725B\u6D25\u5168\u79D1\u738BTA-3000"},{"id":97,"ProductName":"\u725B\u6D25\u5168\u79D1\u738BTA-3000+"},{"id":74,"ProductName":"\u725B\u6D25\u8F9E\u5178\u738BCD-900"},{"id":76,"ProductName":"\u725B\u6D25\u8F9E\u5178\u738BCD-800"},{"id":77,"ProductName":"\u725B\u6D25\u8F9E\u5178\u738BCD-700"},{"id":81,"ProductName":"\u725B\u6D25\u8F9E\u5178\u738BCD-300"}] }

       

      The root point is product?? I don't know..

       

      And here is my script:

       

               var oDS = new YAHOO.util.XHRDataSource("jsonbasic.asp");

               oDS.responseType = YAHOO.util.XHRDataSource.TYPE_TEXT;

      oDS.responseSchema = {

                   resultsList : "ProductName", // String pointer to result data

                   fields : [

                       { key: "ProductName" },                              { key: "id" }

                   ],

               };      

       

      It wont work   ,I dont know why .. .  is there anything wrong with my  responseSchema??

      Please help me! Thank you!

              

    Your message has been successfully submitted and would be delivered to recipients shortly.