Announcement

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

    Change CubeGrid not editable cells style

    Hello,

    Could you help me to change the style of cells matching a FacetValue which is facetValue.setCanEdit(false).

    I look on many method of the api and I found nothing matching to do that.

    Note a Hilite cannot help me, Hilite need an explicit record, and I have only filled record in my grid, but a not editable FacetValue could contains record or not.

    Thx in advance.

    Regards, Emilien.

    1. SmartClient Version: v8.3p_2013-03-13/PowerEdition Deployment (built 2013-03-13)
    2. Version 25.0.1364.160 Ubuntu 12.04 (25.0.1364.160-0ubuntu0.12.04.1)

    #2
    Edit : I found this way in another thread, maybe their is a better way to do this ?

    Code:
      @Override
                  protected String getBaseStyle(ListGridRecord record, int rowNum, int colNum) {
          			  
          			  // the record passed as parameter always refers to the record in the first column
          			  // i.e. all cells in a row becomes the same base style
          			  // after a mouse leave event the correct base style is given to the cell 
          			  
          			  ProductRevenue productRevenueRecord = (ProductRevenue) record;
                     
          			  if (productRevenueRecord.getQuarter("").equals(TRIGGER_RECORD.getQuarter("")) &&
          					  productRevenueRecord.getMonth("").equals(TRIGGER_RECORD.getMonth("")) &&
          					  productRevenueRecord.getRegion("").equals(TRIGGER_RECORD.getRegion("")) &&
          					  productRevenueRecord.getProduct("").equals(TRIGGER_RECORD.getProduct("")) &&
          					  productRevenueRecord.getMetric("").equals(TRIGGER_RECORD.getMetric(""))){
          				  
          				  return "myStyledGridCell";
          				  
          			  } else {
          				  return super.getBaseStyle(record, rowNum, colNum);
          			  }
                  }

    Comment


      #3
      Ok I found what I want to do :

      http://www.smartclient.com/smartgwtee-latest/javadoc/com/smartgwt/client/widgets/grid/ListGrid.html#getCellStyle(com.smartgwt.client.widgets.grid.ListGridRecord, int, int)

      Thx.

      Comment

      Working...
      X