Announcement

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

    CellPadding on listgrid removeRecordField

    SmartClient Version: v9.1p_2014-08-29/Pro Deployment (built 2014-08-29)

    I have a problem with the remove records field of my listgrids when I try to set a cellPadding on them.

    I have tried setting both the cellPadding (via JS) and via CSS. Both cases the remove icon is clipped on the right side.

    I have noticed that when I add a cell padding of 5, the WIDTH of the div container around the image shrinks from 16 to 11 px?


    This is what the generated HTML for the remove cell looks like:

    Without Cell Padding:
    Code:
    <td class="cell" height="26" align="center" style="padding-top: 0px; padding-bottom: 0px; width: 20px; overflow: hidden;">
       <div style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;[b]WIDTH:16px;[/b]" cellclipdiv="true" role="presentation">
          <img width="16" border="0" align="TEXTTOP" draggable="true" suppress="TRUE" src="http://127.0.0.1:8888/forecast/sc/skins/Forecast/images/actions/remove.png">
       </div>
    </td>
    With Cell Padding 5:
    Code:
    <td class="cell" height="26" align="center" style="padding-top: 0px; padding-bottom: 0px; width: 21px; overflow: hidden;">
       <div style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;[b]WIDTH:11px;[/b]" cellclipdiv="true" role="presentation">
          <img width="16" border="0" align="TEXTTOP" draggable="true" suppress="TRUE" src="http://127.0.0.1:8888/forecast/sc/skins/Forecast/images/actions/remove.png">
       </div>
    </td>
    Do you have any solution to this?

    #2
    Fields in the ListGrid clip content (including padding) unless you enable autosizing.

    cellPadding is overridden by padding in the CSS style applied to the cell (in HTML tables in general).

    Comment


      #3
      I have set these two lines on the listGrid.

      Code:
      listGrid.setAutoFitWidthApproach(AutoFitWidthApproach.BOTH);
      listGrid.setAutoFitFieldWidths(true);
      Is this what you mean by autosizing? or is there another property I need to set?

      Notice that this is only a problem for the Remove field that shows when I set

      Code:
      listGrid.setCanRemoveRecords(true);

      Comment


        #4
        Ah - the easiest way to deal with your case is to use setRemoveFieldProperties(...) to set autoFitWidth to true.
        This will cause the Remove field to automatically size to whatever the icon size is (controlled by removeIconSize).

        We've decided this actually makes sense as a framework default for the remove field, so we'll go ahead and make this change in the framework for 5.1 (starting with the next nightly build, Dec 3 or above), but for older branches you can apply the setting yourself.

        Regards
        Isomorphic Software

        Comment


          #5
          Great, Thank you very much.

          Comment

          Working...
          X