Announcement

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

    Autofitting Checkbox in Listgrid

    SmartClient Version: SC_SNAPSHOT-2012-03-01_v8.2p/Pro Deployment (built 2012-03-01)
    Firefox 10.0.2

    I have a Listgrid with 1 check box and 1 text field, it is set up to autofit fields and it works fine
    I have changed the css to add padding to the left of the cells with the following in the .cell, etc class
    padding-left:4px;

    It works fine for everything except checkboxes which are truncated on the right hand side
    The left padding is correctly applied but the autofitting appears not to take it into account when sizing the width of the column

    The code is (and was)
    Code:
        setAutoFitFieldWidths(true);
        setAutoFitWidthApproach(AutoFitWidthApproach.BOTH);
    The header field for the checkbox has no text as it defaults to the field name in the .ds.xml which would be unsuitable and too wide, I have achieved this by using the following in the .ds.xml:
    title=" "


    For reference:
    /*------------------------------------------------------------
    listGrid.baseStyle
    ------------------------------------------------------------*/
    .cell,
    .cellDark,
    .cellOver,
    .cellOverDark,
    .cellSelected,
    .cellSelectedDark,
    .cellSelectedOver,
    .cellSelectedOverDark,
    .cellDisabled,
    .cellDisabledDark,
    .tallCell,
    .tallCellDark,
    .tallCellOver,
    .tallCellOverDark,
    .tallCellSelected,
    .tallCellSelectedDark,
    .tallCellSelectedOver,
    .tallCellSelectedOverDark,
    .tallCellDisabled,
    .tallCellDisabledDark,
    .gridSummaryCell,
    .gridSummaryCellDisabled,
    .groupSummaryCell,
    .groupSummaryCellDisabled,
    .recordSummaryCell,
    .recordSummaryCellDark,
    .recordSummaryCellOver,
    .recordSummaryCellOverDark,
    .recordSummaryCellSelected,
    .recordSummaryCellSelectedDark,
    .recordSummaryCellSelectedOver,
    .recordSummaryCellSelectedOverDark,
    .recordSummaryCellDisabled,
    .recordSummaryCellDisabledDark,
    .expansionCellCell,
    .expansionCellCellDark,
    .expansionCellCellOver,
    .expansionCellCellOverDark,
    .expansionCellCellSelected,
    .expansionCellCellSelectedDark,
    .expansionCellCellSelectedOver,
    .expansionCellCellSelectedOverDark,
    .expansionCellCellDisabled,
    .expansionCellCellDisabledDark,
    .specialCol,
    .specialColOver,
    .specialColSelected,
    .specialColSelectedOver,
    .specialColDisabled,
    .groupNode {
    font-family:Arial,Verdana,sans-serif; font-size:12px; text-overflow:ellipsis;
    color:black;
    background-color:white;
    border-top: 0px solid #808080;
    border-bottom:1px solid #808080;
    border-left:0px solid #808080;
    border-right:1px solid #808080;
    height: 18px;
    padding-left:4px;
    }

    #2
    This is correct, padding in the cell style is currently not correctly accounted for.

    This seems to be a weird styling choice however. Do you really want larger left-hand padding only (not vertical, not right-hand)? Or are you trying to solve some other issue via introducing this padding?

    Note that you can turn off the shortcut for how icon fields are autofit via autoFitIconFields (with a speed penalty).

    Comment


      #3
      Another approach would be to set field.baseStyle for your icon fields so you don't have this extra padding (which may well not be desirable for these fields).

      Comment


        #4
        Thank you for the replies and confirmation regarding padding. I am working to a design and the left padding is what was required, presumably adding padding all around would still truncate

        I tried autoFitIconFields but failed to get it to work for me however I have resolved my problem using setValueIconLeftPadding(0)

        For future reference, is there a specific place or time before/after which that autoFitIconFields can be used to make it give me the desired results? There is nothing obvious to me in JavaDoc

        Many Thanks
        Last edited by paulm; 16 Jan 2013, 07:02.

        Comment


          #5
          Generally you would leave autoFitIconFields alone because its default setting is already correct. We brought it up only in the context of a workaround to accommodate this odd sizing issue.

          Comment

          Working...
          X