Announcement

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

    #16
    Hi Isomorphic,

    thanks again for the information. I'll take that path then and comment it very clearly in my code.

    Best regards
    Blama

    Comment


      #17
      Any follow ups on this? I still have not a working option. Tricking it with CSS does not work on SelectItems.

      Code:
      .formCell [readonly] { background-color: #F0F0F0; } /* give read only fields a different look */
      I don't seem to be able to distinguish between readonly mode or not (for SelectItems). I also tried the approach of setting formItem.setTextStyle() but then the whole form cell has a different background instead of just the field.

      Comment


        #18
        I know this is an old thread, but I actually have the same issue. I created a pragmatic solution by adding this line of CSS on top of the HTML file loading the application:
        Code:
        .formCell [readonly] { ... }
        This works, except for SelectItem components, which don't seem to render the readonly="TRUE" attribute on the generated HTML. Not sure if this is intentionally, but I guess it isn't. ComboBoxItem components work correctly. I now created a subclass of SelectItem, overriding the getElementHTML() method:
        Code:
        getElementHTML: function () {
          const html = this.Super('getElementHTML', arguments);
          return this.canEdit ? html : html.replace('<DIV', '<DIV readonly="TRUE"');
        }
        Not sure if this is correct, but it's not handy because I need to add editorType: "MySelectItem" to fields that normally render as SelectItem. Can I "monkey patch" SelectItem or is this something that needs to be fixed in SmartClient's code?

        Comment

        Working...
        X