Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How can I set value icon mapping

    I'm attempting to specify a datasourcefield in a way that will allow you to click edit a corresponding listgrid cell, with the resulting select item editor showing icons, not values. The effect I'm looking for is how the kludged <ValueMap> example is specified below but I want to do it in a more smartgwt native and theme independent way. Is there a better way to do this with in the <valueMap> attribute or by adding an attribute like the attempted <valueIconMap> one (which would be nice if it worked <hint, hint>) . How should I accomplish this?

    Code:
      Kludged valueMap example:
                 <valueMap>
                     <value ID="left">&lt;img src="barr/sc/skins/Brcm/images/RichTextEditor/text_align_left.png" alt="Left"&gt;</value>
                     <value ID="right">&lt;img src="barr/sc/skins/Brcm/images/RichTextEditor/text_align_right.png" alt="Right"&gt;</value>
                     <value ID="center">&lt;img src="barr/sc/skins/Brcm/images/RichTextEditor/text_align_center.png" alt="Center"&gt;</value>
                   </valueMap>
    Code:
      What I wish could be done:
         <field name="cellAlign" title="Align"                                       type="enum" detail="true" autoFitWidth="true" autoFitWidthApproach="title" cellAlign="center"
                   prompt="Alignment of the column"
                   canEdit="true"
                   allowEmptyValue="true"
                   >
    
                   <valueMap>
                      <value>left</value>
                      <value>right</value>
                      <value>center</value>
                   </valueMap>
    
                   <valueIconMap>
                     <value ID="left">[SKIN]/RichTextEditor/text_align_left.png</value>
                     <value ID="right">[SKIN]/RichTextEditor/text_align_right.png</value>
                     <value ID="center">[SKIN]/RichTextEditor/text_align_center.png</value>
                   </valueIconMap>
    
            </field>

    #2
    valueIcons can be configured via listGridField.valueIcons. They aren't documented on DataSources because DataSources are used by multiple DataBoundComponents, so component-specific properties aren't specified there.

    We wouldn't recommend your hack of trying to the cram icons into the display value from a valueMap, as then they would not be treated as true valueIcons, which would lead to lots of other problems (not getting valueIconClick, for one).

    Comment


      #3
      Thanks, that helps.

      Comment

      Working...
      X