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

Re: Autocomplete - access additional response data

Expand Messages
  • pcraston
    I m having exactly the same problem. Can anyone help? Thanks, Patrick ... instance. ... results ... autocomplete...] ... totalResultsAvailable
    Message 1 of 3 , Nov 30, 2008
    • 0 Attachment
      I'm having exactly the same problem.

      Can anyone help?

      Thanks,
      Patrick

      --- In ydn-javascript@yahoogroups.com, "Martin Tschofen"
      <martin.tschofen@...> wrote:
      >
      > I'd like to show the number of items returned from my autocomplete
      instance.
      >
      > I'm using JSON data from a server.
      >
      > dataSource = new YAHOO.widget.DS_XHR(root,
      > ["ResultSet.Stores","Number","Name","Address", "PartyId"]);
      >
      > My JSON object returns the number of items as meta data above the
      results
      > for the autocomplete ('stores').
      >
      > {"ResultSet":
      >
      > {"totalResultsAvailable":"22000000",
      >
      > "totalResultsReturned":15,
      >
      > "Stores": [...contains the results to display in the
      autocomplete...]
      > }
      > }
      >
      > I subscribed to dataReturnEvent(oSelf , sQuery , aResults).
      >
      > But I can't figure out how to access any values (the
      totalResultsAvailable
      > or totalResultsReturned) from the raw data.
      >
      > Thanks in advance...martin
      >
    • Eric Miraglia
      Patrick and Martin, Jenny Han Donnelly, the AutoComplete author, notes that AutoComplete provides access to DataSource meta fields via the doBeforeLoadData()
      Message 2 of 3 , Dec 1, 2008
      • 0 Attachment
        Patrick and Martin,

        Jenny Han Donnelly, the AutoComplete author, notes that AutoComplete provides access to DataSource meta fields via the doBeforeLoadData() function.  Meta fields are the best way to handle this.  Take a look at this example:


        Let me know if you have any further questions.

        -Eric


        On Nov 30, 2008, at 2:42 AM, pcraston wrote:

        I'm having exactly the same problem.

        Can anyone help?

        Thanks,
        Patrick

        --- In ydn-javascript@ yahoogroups. com, "Martin Tschofen"
        <martin.tschofen@ ...> wrote:
        >
        > I'd like to show the number of items returned from my autocomplete
        instance.
        > 
        > I'm using JSON data from a server.
        > 
        > dataSource = new YAHOO.widget. DS_XHR(root,
        > ["ResultSet. Stores"," Number"," Name","Address" , "PartyId"]);
        > 
        > My JSON object returns the number of items as meta data above the
        results
        > for the autocomplete ('stores').
        > 
        > {"ResultSet" :
        > 
        > {"totalResultsAvail able":"22000000" ,
        > 
        > "totalResultsReturn ed":15,
        > 
        > "Stores": [...contains the results to display in the
        autocomplete. ..]
        > }
        > }
        > 
        > I subscribed to dataReturnEvent( oSelf , sQuery , aResults).
        > 
        > But I can't figure out how to access any values (the
        totalResultsAvailab le
        > or totalResultsReturne d) from the raw data.
        > 
        > Thanks in advance...martin
        >


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