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

autocomplete/dataReturnEvent to overwrite the drop down body content

Expand Messages
  • deanjennings99
    I have a need to occasionally reorder the data returned from the dataSource for an autoComplete control. I am trying to use the dataReturnEvent to capture the
    Message 1 of 2 , Sep 23, 2008
    • 0 Attachment
      I have a need to occasionally reorder the data returned from the dataSource for an
      autoComplete control. I am trying to use the dataReturnEvent to capture the returned data,
      modify the order as needed and replace the drop down list by using the setBody method. I
      build the unordered list as appropriate and issue the setBody which works fine. However, the
      list that now appears in the 'drop down' is not selectable. That is to say that clicking on an
      item in the new list has no effect. Nothing even highlights.

      All of the examples that I can find simply change the body content to say that no data was
      returned or some message where select-ability is not an issue. I can find no examples where
      the returned data was modified or replaced and that list is then selectable.

      Has anyone done this in the past or know of a decent example?

      As always, thanks in advance

      Dean
    • jennykhan
      Hi Dean, As of version 2.6.0, AutoComplete provides the doBeforeLoadData() abstract method. Override that to reorder your data before it gets rendered into the
      Message 2 of 2 , Oct 10, 2008
      • 0 Attachment
        Hi Dean,

        As of version 2.6.0, AutoComplete provides the doBeforeLoadData()
        abstract method. Override that to reorder your data before it gets
        rendered into the container.

        http://developer.yahoo.com/yui/docs/YAHOO.widget.AutoComplete.html#me
        thod_doBeforeLoadData

        Regards,
        Jenny



        --- In ydn-javascript@yahoogroups.com, "deanjennings99" <dean@...>
        wrote:
        >
        > I have a need to occasionally reorder the data returned from the
        dataSource for an
        > autoComplete control. I am trying to use the dataReturnEvent to
        capture the returned data,
        > modify the order as needed and replace the drop down list by using
        the setBody method. I
        > build the unordered list as appropriate and issue the setBody
        which works fine. However, the
        > list that now appears in the 'drop down' is not selectable. That
        is to say that clicking on an
        > item in the new list has no effect. Nothing even highlights.
        >
        > All of the examples that I can find simply change the body content
        to say that no data was
        > returned or some message where select-ability is not an issue. I
        can find no examples where
        > the returned data was modified or replaced and that list is then
        selectable.
        >
        > Has anyone done this in the past or know of a decent example?
        >
        > As always, thanks in advance
        >
        > Dean
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.