How to splice Row in WjMultiRow

Posted by: ngvanthuong97 on 25 December 2019, 5:46 am EST

  • Posted 25 December 2019, 5:46 am EST

    Hi everyone,

    I want to create a multi-row grid, so I use WjMultiRow through properties:

    layoutDefinition()

    class CellMulti {
      constructor(
        public binding: string,
        public header: string,
        public cssClass?: string,
        public format?: string,
        public isReadOnly?: boolean,
        public wordWrap?: boolean,
        public width?: number,
        public colspan?: number,
        public rowspan?: number,
        public align?: string,
        public dataType?: string,
        public dataMap?: DataMap,
        public visible?: boolean,
      ) { }
    }
    class Line {
      constructor(
        public cells: CellMulti[],
        public header?: string,
        public colspan?: number,
        public rowspan?: number,
      ) { }
    }
    

    But, My grid just have 2 lines/recor when I want to my header have 3 lines (Please see attached photo)

    I have tried many ways but still have not found the answer, please help me if you have any idea

    Thanks!

  • Posted 26 December 2019, 7:58 am EST

    Hi,

    The MultiRow is a little bit different control then FlexGrid. You cannot add a single row to the columnHeaders of the MultiRow. The number of rows added should be equal to the number of records per item, which is 2 in your case.

    So, you will need to add 2 rows to the headers and hide anyone of them.

    To merge the data in this new row, you will need to add your own custom merging logic by overriding the getMergedRange method of the MultiRow.

    You may refer to the sample attached for reference.

    Regards,

    Ashwin

    sample.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels