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

Re: DataTable + dropdown editor

Expand Messages
  • slapyo
    ... still looking for a solution to this. looking for a value/text format for a column, without the dropdown look. when the user clicks on this field to edit
    Message 1 of 4 , Jul 31, 2008
      --- In ydn-javascript@yahoogroups.com, "slapyo" <slapyo@...> wrote:
      >
      > Dunno if this is possible.
      >
      > I have a value/text combo. I would like for the column to display the
      > text, but store the value. I can do this if I put
      > formatter:"dropdown" ... but then it always displays as a dropdown
      > which I don't want to show until the editor loads. I am hoping there
      > is a way I can do this.
      >
      > I've seen this in the example with the state abbreviations but I
      > didn't see anywhere for a value/text combo, it was just the state
      > abbreviations. If I remove the formatter:"dropdown" then all I get
      > the value displaying with the dropdown appearing when editing.
      >
      still looking for a solution to this.

      looking for a value/text format for a column, without the dropdown
      look. when the user clicks on this field to edit it, the editor
      appears and displays a dropdown.
    • Satyam
      You can assign the dropdown inline cell editor to the column. When the cell is clicked, the dropdown cell editor will show. You can see it working in the
      Message 2 of 4 , Aug 2, 2008
        You can assign the dropdown inline cell editor to the column.  When the cell is clicked, the dropdown cell editor will show. 

        You can see it working in the State column in:

        http://developer.yahoo.com/yui/examples/datatable/dt_cellediting.html

        The column is defined by:
         {key:"state", editor:"dropdown", editorOptions:{dropdownOptions:YAHOO.example.Data.stateAbbrs}},
        

        Where stateAbbrs is a simple array containing the strings with the two letter abbreviations.  DataTable can also read an array of object literals with properties called text and value if the displayed value and the internal value are not the same.

        You will have to provide your own formatter function to show the display text for the stored value.  The dropdown formatter and the editor don't get along well, they actually overlap in functionality.  If the option value and description match, as in the above example, you need no formatter, the stored value is the same as the one displayed. If they don't match, you have to provide the formatter yourself to do the conversion.

        Satyam



        slapyo wrote:
        --- In ydn-javascript@yahoogroups.com, "slapyo" <slapyo@...> wrote:
          
        Dunno if this is possible.
        
        I have a value/text combo.  I would like for the column to display the
        text, but store the value.  I can do this if I put
        formatter:"dropdown" ... but then it always displays as a dropdown
        which I don't want to show until the editor loads.  I am hoping there
        is a way I can do this.
        
        I've seen this in the example with the state abbreviations but I
        didn't see anywhere for a value/text combo, it was just the state
        abbreviations.  If I remove the formatter:"dropdown" then all I get
        the value displaying with the dropdown appearing when editing.
        
            
        still looking for a solution to this.
        
        looking for a value/text format for a column, without the dropdown
        look.  when the user clicks on this field to edit it, the editor
        appears and displays a dropdown.
        
        
        ------------------------------------
        
        Yahoo! Groups Links
        
        <*> To visit your group on the web, go to:
            http://groups.yahoo.com/group/ydn-javascript/
        
        <*> Your email settings:
            Individual Email | Traditional
        
        <*> To change settings online go to:
            http://groups.yahoo.com/group/ydn-javascript/join
            (Yahoo! ID required)
        
        <*> To change settings via email:
            mailto:ydn-javascript-digest@yahoogroups.com 
            mailto:ydn-javascript-fullfeatured@yahoogroups.com
        
        <*> To unsubscribe from this group, send an email to:
            ydn-javascript-unsubscribe@yahoogroups.com
        
        <*> Your use of Yahoo! Groups is subject to:
            http://docs.yahoo.com/info/terms/
        
        
        No virus found in this incoming message.
        Checked by AVG - http://www.avg.com 
        Version: 8.0.138 / Virus Database: 270.5.10/1584 - Release Date: 31/07/2008 12:00
        
        
        
          
      • slapyo
        ... editorOptions:{dropdownOptions:YAHOO.example.Data.stateAbbrs}}, ... display ... Thanks. I thought that was what I was going to have to do.
        Message 3 of 4 , Aug 2, 2008
          --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
          >
          > You can assign the dropdown inline cell editor to the column. When the
          > cell is clicked, the dropdown cell editor will show.
          >
          > You can see it working in the State column in:
          >
          > http://developer.yahoo.com/yui/examples/datatable/dt_cellediting.html
          >
          > The column is defined by:
          >
          > {key:"state", editor:"dropdown",
          editorOptions:{dropdownOptions:YAHOO.example.Data.stateAbbrs}},
          >
          >
          > Where stateAbbrs is a simple array containing the strings with the two
          > letter abbreviations. DataTable can also read an array of object
          > literals with properties called text and value if the displayed value
          > and the internal value are not the same.
          >
          > You will have to provide your own formatter function to show the
          display
          > text for the stored value. The dropdown formatter and the editor don't
          > get along well, they actually overlap in functionality. If the option
          > value and description match, as in the above example, you need no
          > formatter, the stored value is the same as the one displayed. If they
          > don't match, you have to provide the formatter yourself to do the
          > conversion.
          >
          > Satyam
          >

          Thanks. I thought that was what I was going to have to do.
        Your message has been successfully submitted and would be delivered to recipients shortly.