How to format a specific row

Posted by: wmeng on 1 February 2019, 12:56 pm EST

  • Posted 1 February 2019, 12:56 pm EST

    How I can only format((eg. Bold) specific row based on one of the cell value in this row, not entire grid?
  • Marked as Answer

    Replied 3 February 2019, 8:49 pm EST

    Hi,

    We are sorry but there is no direct way of formatting a specific row in the spread.views.
    However, we can assign conditional templates to the column to add/remove a specific CSS class for the row and then use that CSS class to format the cell as required.
    Please refer to the following code snippet:
    var presenter = '<div class="'+
    '{{? it.id == 1}}' +
    'bold-text-row' +
    '{{?? true}}' +
    'normal-text' +
    '{{?}}' +
    '">' +
    '{{=it.id}}' +
    '</div>';
    var columns = [{
    id: 'id',
    caption: 'Id',
    dataField: 'id',
    presenter: presenter,
    }];


    You may also refer to the attached sample demonstrating the same.Presenter.zip
Need extra support?

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

Learn More

Forum Channels