Announcement

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

    Styling editable fields in FieldPicker

    Hello, is there an API that would allow us to apply special styling to fields in the advanced FieldPicker grid to indicate the field is editable? We have a grid with hundreds of fields and users are asking for an easy visual cue that would tell them which fields are editable. It could be styling on the sample values or an additional column or just a suffix on the field title perhaps. We are using 12.1.

    #2
    It's a long chain of AutoChildren, but you can get there: listGrid.fieldPickerWindow > fieldPicker > currentFieldsGrid. So you could, for instance, install a getCellCSSText() implementation that checks the field's editability and applies different styling. Or a hover that gives various information about the field.

    Comment


      #3
      Thank you. I accomplished this with the following to style the Sample Value cells in the Field Picker with similar styling we use to denote editable fields in the main grid for future reference:

      Code:
          isc.FieldPickerListGrid.addMethods({
              getBaseStyle:function (record, rowNum, colNum){ 
      
                  var baseStyle = this.Super("getBaseStyle", arguments);
      
                  if(colNum!=null){
                      var field = this.getField(colNum);
      
                      if(field!=null && field.title!=null &&  field.title.trim()=="Sample Value"){
      
                          if(record!=null && this.creator!=null && this.creator.dataBoundComponent!=null){
      
                              var dbc = this.creator.dataBoundComponent;
      
                              var dbcField = dbc.getFieldByName(record.name);
      
                              if(dbcField!=null && dbcField.canEdit){
                                  baseStyle = 'editableATCellFieldPicker';                                
                              }
                          }
                      }
      
                  }
      
                  return baseStyle;            
      
              }
      
          })

      Comment

      Working...
      X