Announcement

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

    FormItem dynamic picker icon

    Hi,

    How can one dynamically change the picker icon SRC attached to a FormItem created using the built-in picker feature?

    I need to have the picker icon image to be changed, based on whether the value for the FormItem is set or cleared.

    Thanks for any insight,

    #2
    This should work:

    formItem.getIcon(name).src = newValue;
    formItem.redraw()

    Comment


      #3
      Thanks that works!

      On the same topic ... 2 more questions ...

      1) Is there a way to have the picker tooltip modified dynamically, after the button gets created. I want to display
      a different picker tooltip when a value is set or cleared in the associated FormItem.

      2) Is there a way for these picker icons to observe the standard '_Disabled', '_Over', etc suffix convention (or any
      other mechanism you can provide). I want to display a different icon when hovering the picker button.

      Thanks again for your help,

      Comment


        #4
        For the most part you can think of the picker (at least in terms of customization) like any other FormItemIcon. There are some special picker-specific properties (like pickerIconName, showFocusedPickerIcon, ...) but the icon can also be customized or updated as you would modify any other icon for the item.

        To answer your questions, you could call
        Code:
        item.getIcon("picker").prompt = "New Prompt";
        To update the pickerIcon prompt at runtime.
        To get Over styling for the image, you could turn on icon.showOver for the picker icon
        Code:
        pickerIconProperties:{
            showOver:true
        }
        The Disabled image suffix for the pickerIcon should show up when the item is disabled by default. You can avoid this via the neverDisable attribute.

        If you need to show Focused state when the item as a whole has focus, you can also use showFocusedPickerIcon.

        Beyond that, you can of course explicitly set the icon src as described in the earlier post!
        Hopefully this gives you enough to get the behavior you need.

        Comment


          #5
          Thanks for those tips. Now I get a better idea of how this works!

          Kind regards,

          Comment

          Working...
          X