jQWidgets Forums

jQuery UI Widgets Forums Grid Grid cell padding

This topic contains 2 replies, has 2 voices, and was last updated by  Weibing 9 years ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Grid cell padding #83502

    Weibing
    Participant

    I’m using the cellsrenderer function to change the background color of the row. Works great. However, is there any way to reduce the cell padding so the background color encompasses the entire cell, not just around the text?

    Thanks

    B

    var cellsrenderer = function(row, column, value, defaultHtml, columnSettings, record) {
    var credit = record.credit
    if(credit == 0){
    var element = $(defaultHtml);
    element.css({ ‘background-color’: ‘#f8d5d5’});
    return element[0].outerHTML;
    }
    return defaultHtml;

    }

    Grid cell padding #83515

    ivailo
    Participant

    Hi Weibing,

    Better use cellclassname. It sets a custom CSS class for the column’s cells.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    Grid cell padding #83541

    Weibing
    Participant

    Great Thanks.

    var cellclass = function (row, columnfield, value, record) {
    var credit = record.credit;
    if(credit == 0){
    return ‘red’;
    }

    }

    <style>
    .red:not(.jqx-grid-cell-hover):not(.jqx-grid-cell-selected), .jqx-widget .red:not(.jqx-grid-cell-hover):not(.jqx-grid-cell-selected) {
    color: black;
    background-color: #f8d5d5;
    }
    </style>

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.