Announcement

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

    Fix the row height in list grid

    I am using SC version 8.3

    In Smartclient Listgrid we have a requirement to fix the row height. If we have a huge data in any column then it should get truncated.
    To achieve the above requirement SC provides following property :
    fixedRecordHeights: true,
    cellHeight:70

    But the effect of above properties get nullified if we use property showRecordComponents: true

    I have to use showRecordComponents: true because further I am using

    createRecordComponent:function (record, colNum) {
    var grid = this;
    var fieldName = this.getFieldName(colNum);
    if (fieldName == 'optionBtn') {
    return isc.HLayout.create({
    members:[
    isc.LinkButton.create({
    width:70,
    icon:Res.icon.view,
    iconAlign:"center",
    title:"View",
    align:"center",
    click:function () {
    //something
    }
    }),
    isc.LinkButton.create({
    width:70,
    icon:Res.icon.edit,
    iconAlign:"center",
    title:"Edit",
    align:"center",
    click:function () {
    //something
    }
    }),
    isc.LinkButton.create({
    width:70,
    icon:Res.icon.del,
    iconAlign:"center",
    title:"Delete",
    align:"center",
    click:function () {
    //something
    }
    }),
    ],
    height: 16,
    margin:0,
    layoutMargin:0,
    align: "center",
    membersMargin: 6
    });
    }
    else
    return null;
    }


    What can I do to restrict the row height ?

    #2
    Did you already set enforceVClipping as the docs say?

    Comment


      #3
      Yes I have already set enforceVClipping:true

      Just refer example : http://www.smartclient.com/docs/8.3/...#autofitValues

      In the above example, set these properties :
      showRecordComponents: true,
      wrapCells: true,
      fixedRecordHeights: true,
      cellHeight:70,
      enforceVClipping:true

      Record height is not fixed.

      Now just comment the line showRecordComponents: true and observe (height is fixed now)

      Comment


        #4
        Sorry, to clarify, for a recordComponent, the size of the cell can depend on the recordComponent or vice versa (see recordComponentPosition), but a recordComponent will never be clipped by the row boundary. You need to set the recordComponent to the size you want if you want it shorter.

        Comment


          #5
          There is no problem with my record component.
          The size of record component is less than the record height that I am providing.

          There is one more column "description" of type "text" in the same list grid. This column is creating the problem. The data in this column is usually more and this column is responsible for extending the height.

          Comment


            #6
            Text is successfully clipped by the settings we gave - you can see this in samples. If you're having trouble with this, we'll need to see a minimal, ready-to-run testcase demonstrating the issue.

            Comment


              #7
              Goto the link below :
              http://smartclient.com/docs/8.3/a/system/reference/SmartClient_Explorer.html#multilineValues

              and paste the below code in the js of above link:

              isc.ListGrid.create({
              ID: "countryList",
              width:"100%", height:"100%", alternateRecordStyles:true,
              data: countryData,
              fields:[
              {name:"countryName", title:"Country", width:120},
              {name:"background", title:"Background"},
              {name:"countryCode", title:"Flag", align:"center", width:50, type:"image", imageSize:24, imageURLPrefix:"flags/24/", imageURLSuffix:".png"},
              {name: "optionBtn", title: " ",emptyCellValue: '',width:80}
              ],
              wrapCells: true,
              cellHeight: 56,
              showRecordComponents: true,
              fixedRecordHeights: true,
              enforceVClipping:true,
              createRecordComponent:function (record, colNum) {
              var grid = this;
              var fieldName = this.getFieldName(colNum);
              if (fieldName == 'optionBtn') {
              return isc.HLayout.create({
              members:[
              isc.Button.create({
              width:70,
              name:"View",
              title:"View",
              align:"center",
              click:function () {
              //TODO
              }
              })
              ],
              height: 16,
              margin:0,
              layoutMargin:0,
              align: "center",
              membersMargin: 6
              });
              }
              else
              return null;
              }
              })

              Comment


                #8
                This test case is broken (clearly intended to set showRecordComponentsByCell, and in the absence of this setting, doesn't produce recordComponents at all) but we were able to reproduce a problem by fixing the test case. It's queued to be looked at.

                Comment


                  #9
                  We've now made a change to address this in 8.0p, 9.0p and 9.1d branches.
                  Please try the next nightly build (Aug 23 or above) and let us know if you continue to have problems with it.

                  Regards
                  Isomorphic Software

                  Comment

                  Working...
                  X