jQWidgets Forums

jQuery UI Widgets Forums Grid cellsrenderer and source

This topic contains 2 replies, has 2 voices, and was last updated by  morfeusz 12 years, 3 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • cellsrenderer and source #15336

    morfeusz
    Participant

    Hello,
    how can I have a row data from source in this renderer function:
    cellsrenderer = function (row, column, value, defaultHtml) {}

    I’m trying this:

    var cellsrenderer = function (row, column, value, defaultHtml) {
    if (dataAdapter.records[row].checked != "false") {
    var element = $(defaultHtml);
    element.css({ 'background-color': '#D4E7ED', 'width': '100%', 'height': '100%', 'margin': '0px', 'padding' : '3px' });
    return element[0].outerHTML;
    }
    return defaultHtml;
    }

    but when I filtering it’s colouring wrong rows.

    cellsrenderer and source #15350

    Peter Stoev
    Keymaster

    Hi morfeusz,

    You can use the “getrowdata” method of our jQuery Grid. You can take a look at the Grid’s API about further information about that method.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    cellsrenderer and source #15364

    morfeusz
    Participant
    var cellsrenderer = function (row, column, value, defaultHtml) {
    if ($("#grid").jqxGrid('getrowdata', row).checked != false) {
    var element = $(defaultHtml);
    element.css({ 'background-color': '#D4E7ED', 'width': '100%', 'height': '100%', 'margin': '0px', 'padding' : '3px' });
    return element[0].outerHTML;
    }
    return defaultHtml;
    }

    Now it works – thank you for help.

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

You must be logged in to reply to this topic.