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

Re: Dropdown list

Expand Messages
  • itzukepwn
    Thanks, but I think I wasn t good enough in explaining the problem. I want to have this kind of dropdown list Volvo
    Message 1 of 9 , Nov 2 7:35 AM
      Thanks, but I think I wasn't good enough in explaining the problem.
      I want to have this kind of dropdown list

      <select>
      <option value ="volvo">Volvo</option>
      <option value ="saab">Saab</option>
      <option value ="opel">Opel</option>
      <option value ="audi">Audi</option>
      </select>

      in the first <th>.

      --- In ydn-javascript@yahoogroups.com, "Satyam" <satyam@...> wrote:
      >
      > This example uses a dropdown for the state:
      >
      > http://developer.yahoo.com/yui/examples/datatable/dt_cellediting.html
      >
      > Satyam
    • Satyam
      I was unsure of your question, when you said header I was wondering if you meant the actual HTML table header or the column headers definition. I opted
      Message 2 of 9 , Nov 2 9:02 AM
        I was unsure of your question, when you said 'header' I was wondering if you
        meant the actual HTML table header or the 'column headers' definition. I
        opted for the easier one.

        I was able to put your sample dropdown in the header by passing it as a
        string to the label property:

        dt.columnHeaders = [
        {key:'brand',label:'<select id="make"><option value
        ="volvo">Volvo</option><option value ="saab">Saab</option><option value
        ="opel">Opel</option><option value ="audi">Audi</option></select>', ....

        You can set a listener for that element after instantiating the DataTable:

        YAHOO.util.Event.on('make','change',function() {
        alert('click');
        });

        Satyam

        ----- Original Message -----
        From: "itzukepwn" <itzukepwn@...>
        To: <ydn-javascript@yahoogroups.com>
        Sent: Friday, November 02, 2007 3:35 PM
        Subject: [ydn-javascript] Re: Dropdown list


        > Thanks, but I think I wasn't good enough in explaining the problem.
        > I want to have this kind of dropdown list
        >
        > <select>
        > <option value ="volvo">Volvo</option>
        > <option value ="saab">Saab</option>
        > <option value ="opel">Opel</option>
        > <option value ="audi">Audi</option>
        > </select>
        >
        > in the first <th>.
        >
        > --- In ydn-javascript@yahoogroups.com, "Satyam" <satyam@...> wrote:
        >>
        >> This example uses a dropdown for the state:
        >>
        >> http://developer.yahoo.com/yui/examples/datatable/dt_cellediting.html
        >>
        >> Satyam
        >
        >
        >
        >
        >
        > Yahoo! Groups Links
        >
        >
        >
        >
        >
        > --
        > No virus found in this incoming message.
        > Checked by AVG Free Edition.
        > Version: 7.5.503 / Virus Database: 269.15.18/1104 - Release Date:
        > 01/11/2007 18:47
        >
        >
      • itzukepwn
        Thanks. I tried that earlier. When I pass an empty dropdown appears. So far so good. But when I put some tags inside the
        Message 3 of 9 , Nov 2 9:36 AM
          Thanks. I tried that earlier. When I pass <select
          id="someid"></select> an empty dropdown appears. So far so good. But
          when I put some <option> tags inside the whole table is invisible. :/
          In your code dt.columnHeaders is the column definition, which is later
          passe to the datatable constructor, right?

          --- In ydn-javascript@yahoogroups.com, "Satyam" <satyam@...> wrote:
          >
          > I was unsure of your question, when you said 'header' I was
          wondering if you
          > meant the actual HTML table header or the 'column headers'
          definition. I
          > opted for the easier one.
          >
          > I was able to put your sample dropdown in the header by passing it as a
          > string to the label property:
          >
          > dt.columnHeaders = [
          > {key:'brand',label:'<select id="make"><option value
          > ="volvo">Volvo</option><option value ="saab">Saab</option><option value
          > ="opel">Opel</option><option value ="audi">Audi</option></select>', ....
          >
          > You can set a listener for that element after instantiating the
          DataTable:
          >
          > YAHOO.util.Event.on('make','change',function() {
          > alert('click');
          > });
          >
          > Satyam
        • Satyam
          The code I put in the message is the one I took from the test page, and which worked just fine. I put that very same dropdown instead of a heading in a working
          Message 4 of 9 , Nov 2 12:12 PM
            The code I put in the message is the one I took from the test page, and
            which worked just fine. I put that very same dropdown instead of a heading
            in a working page of mine with a DataTable and just worked. There might be
            something elsewhere. Whatever you put in the label property will go
            unfiltered into the innerHTML property of the TH element so it should work.

            Satyam



            ----- Original Message -----
            From: "itzukepwn" <itzukepwn@...>
            To: <ydn-javascript@yahoogroups.com>
            Sent: Friday, November 02, 2007 5:36 PM
            Subject: [ydn-javascript] Re: Dropdown list


            > Thanks. I tried that earlier. When I pass <select
            > id="someid"></select> an empty dropdown appears. So far so good. But
            > when I put some <option> tags inside the whole table is invisible. :/
            > In your code dt.columnHeaders is the column definition, which is later
            > passe to the datatable constructor, right?
            >
            > --- In ydn-javascript@yahoogroups.com, "Satyam" <satyam@...> wrote:
            >>
            >> I was unsure of your question, when you said 'header' I was
            > wondering if you
            >> meant the actual HTML table header or the 'column headers'
            > definition. I
            >> opted for the easier one.
            >>
            >> I was able to put your sample dropdown in the header by passing it as a
            >> string to the label property:
            >>
            >> dt.columnHeaders = [
            >> {key:'brand',label:'<select id="make"><option value
            >> ="volvo">Volvo</option><option value ="saab">Saab</option><option value
            >> ="opel">Opel</option><option value ="audi">Audi</option></select>', ....
            >>
            >> You can set a listener for that element after instantiating the
            > DataTable:
            >>
            >> YAHOO.util.Event.on('make','change',function() {
            >> alert('click');
            >> });
            >>
            >> Satyam
            >
            >
            >
            >
            > Yahoo! Groups Links
            >
            >
            >
            >
            >
            > --
            > No virus found in this incoming message.
            > Checked by AVG Free Edition.
            > Version: 7.5.503 / Virus Database: 269.15.18/1104 - Release Date:
            > 01/11/2007 18:47
            >
            >
          • itzukepwn
            Thank you, it works now. The problem was that the string I passed to label:, was with double quotes and I put (unintentionally) double quotes in it. But I
            Message 5 of 9 , Nov 5 6:15 AM
              Thank you, it works now. The problem was that the string I passed to
              label:, was with double quotes and I put (unintentionally) double
              quotes in it. But I fixed it. Have a nice day.



              --- In ydn-javascript@yahoogroups.com, "Satyam" <satyam@...> wrote:
              >
              > The code I put in the message is the one I took from the test page, and
              > which worked just fine. I put that very same dropdown instead of a
              heading
              > in a working page of mine with a DataTable and just worked. There
              might be
              > something elsewhere. Whatever you put in the label property will go
              > unfiltered into the innerHTML property of the TH element so it
              should work.
              >
              > Satyam
            • Jeremy Hubble
              I have one data field in my datatable that contains numbers that I want to display as more user-friendly text. 1 - Some Text 2 - Some more text 7 - A
              Message 6 of 9 , Nov 15 2:40 PM
                I have one data field in my datatable that contains numbers that I want
                to display as more user-friendly text.

                1 -> Some Text
                2 -> Some more text
                7 -> A different string

                The numbers are not a complete set (some numbers do not correspond to
                anything)

                I am able to easily format the display by putting the numbers and
                strings in an object, and then using a formatter to get the appropriate
                number.

                However, I would also like to be able to use a dropdown editor with the
                field. The user should be able to select from the valid list of
                descriptions, and then have the appropriate number stored in the
                datatable (and written back.) However, it appears that datatable
                expects to store the actual data in the dropdown. Is there a way to
                use a dropdown where the stored value is not equal to the displayed value?


                ____________________________________________________________________________________
                Never miss a thing. Make Yahoo your home page.
                http://www.yahoo.com/r/hs
              • Jeremy Hubble
                To answer my own question - Looking through the code, it appears that you can pass an optionslist array. It will then use those options with the name/value
                Message 7 of 9 , Nov 15 9:13 PM
                  To answer my own question -

                  Looking through the code, it appears that you can pass an optionslist
                  array. It will then use those options with the name/value pairs in the
                  dropdown menu.


                  > I have one data field in my datatable that contains numbers that I
                  > want
                  > to display as more user-friendly text.
                  >
                  > 1 -> Some Text
                  > 2 -> Some more text
                  > 7 -> A different string
                  >
                  > The numbers are not a complete set (some numbers do not correspond to
                  > anything)
                  >
                  > I am able to easily format the display by putting the numbers and
                  > strings in an object, and then using a formatter to get the
                  > appropriate
                  > number.
                  >
                  > However, I would also like to be able to use a dropdown editor with
                  > the
                  > field. The user should be able to select from the valid list of
                  > descriptions, and then have the appropriate number stored in the
                  > datatable (and written back.) However, it appears that datatable
                  > expects to store the actual data in the dropdown. Is there a way to
                  > use a dropdown where the stored value is not equal to the displayed
                  > value?
                  >
                  >
                  >
                  >
                  ____________________________________________________________________________________
                  > Never miss a thing. Make Yahoo your home page.
                  > http://www.yahoo.com/r/hs
                  >



                  ____________________________________________________________________________________
                  Be a better pen pal.
                  Text or chat with friends inside Yahoo! Mail. See how. http://overview.mail.yahoo.com/
                Your message has been successfully submitted and would be delivered to recipients shortly.