Announcement

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

    colspan for the List Grid column header

    Hi

    I need my List Grid column header to span across two columns. How to do it. I am using dataSource and the fields are defined in the dataSource.create code. I can specify few attribute properties like canEdit, canSort etc.. but colSpan is not working.
    Please help me.


    Thanks in advance
    Strive

    #2
    Use a single column and create the appearance of two separate cells using formatCellValue to output, for example, a simple 2 cell HTML table.

    Comment


      #3
      Hi Isomorphic,

      To format the cell value using formatCellValue: the data does not belong to only one cell... in datasource there are two elements for list grid headers. 1st element do not have any title, but the second element has a tirle. i want to merge them.

      the grid should like:
      Code:
           Profit
      Books      1000
      Pens       1000
      Erasers    1000
      The examples that i saw were: take a cell value and customize them using formatCellValue:

      Comment


        #4
        Hi Strive
        formatCellValue takes a second parameter "record" which gives you access to all the fields of the record for the row.
        So your formatCellValue could return something like this:

        Code:
        formatCellValue: function (value, record) {
            if (record != null) {
                return "<table width='100%'><tr><td align=left>" + record.countryCode 
                          + "</td><td align=right>" + record.countryName + "</td></tr></table>"
            }
        }
        This is just a starting point - you may need to tweak the styling of the cell, etc, but it should get you going

        Thanks
        Isomorphic Software

        Comment

        Working...
        X