locked
details picker issue RRS feed

  • Question

  • I am trying to toggle .isEnabled on a details picker based on the value of another property (classic Country => State cascading dropdown).  Everything works except when the country picker is null, I want the state picker to be disabled. If you use: screen.findContentItem("statePicker").isEnabled = false; the details picker renders as a regular dropdown box (disabled). And, when you toggle it back to .isEnabled = true; it still renders as a regular dropdown box (enabled), the plus sign is gone and you can't type in the input.  Anyone know how to enable/disable the details picker in a way that allows it render normally?  Do I need to use setTimeout or something?  This is driving me crazy because otherwise the cascading dropdown works like a charm.
    Saturday, April 18, 2015 10:56 PM

Answers

  • Hi Hessc,

    I cheat and put the State in the screen content twice, once as text and once as details picker. Then manipulate the isVisible instead.

    :O

    Dave


    Dave Baker | AIDE for LightSwitch | Xpert360 blog | twitter : @xpert360 | Xpert360 website | Opinions are my own. For better forums, remember to mark posts as helpful/answer.

    • Marked as answer by Angie Xu Monday, April 27, 2015 1:24 PM
    Sunday, April 19, 2015 8:51 AM

All replies

  • Hi Hessc,

    I cheat and put the State in the screen content twice, once as text and once as details picker. Then manipulate the isVisible instead.

    :O

    Dave


    Dave Baker | AIDE for LightSwitch | Xpert360 blog | twitter : @xpert360 | Xpert360 website | Opinions are my own. For better forums, remember to mark posts as helpful/answer.

    • Marked as answer by Angie Xu Monday, April 27, 2015 1:24 PM
    Sunday, April 19, 2015 8:51 AM
  • Thanks Dave. I'll gave that one a try.  It is a shame the details picker is so buggy.  I hope they fix that.
    Sunday, April 19, 2015 6:43 PM