jQWidgets Forums

jQuery UI Widgets Forums Grid Change Row style based in one cell

This topic contains 2 replies, has 2 voices, and was last updated by  Dimitar 10 years, 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Change Row style based in one cell #56755

    mikesantos
    Participant

    Hi,

    I need to change the style of the entire row based in a cell value.
    I’m trying to use the cellclassname as follows, but I don’t know how to check the cell value (status), because the id of the grid is created dinamicaly and I don’t know how to select it. Is there a better way to do it?

    `var cellclass_captacao = function (row, columnfield, value, defaulthtml, columnproperties) {
    var status = $(?????).jqxGrid(‘getCell’, row, ‘status’);
    if(status.value == ‘2’){
    return ‘captacao_row’;
    }
    }

    columns = [
    {
    text : ‘status’,
    datafield : ‘status’,
    hidden:true
    },
    {
    text : ‘Bairro’,
    datafield : ‘bairro’,
    cellsalign : ‘left’,
    cellclassname: cellclass_captacao
    },
    {
    text : ‘Dormitórios’,
    datafield : ‘n_dormitorios’,
    cellsalign : ‘center’,
    cellclassname: cellclass_captacao
    }
    ];

    var source = {
    datatype : ‘json’,
    type: ‘POST’,
    data: {action:action},
    datafields : datafields,
    url : ‘php/lists.php’,

    };

    var dataAdapter = new $.jqx.dataAdapter(source);

    $(“#”+tab+”-int”).jqxGrid({
    width: ‘100%’,
    height: ‘94%’,
    source: dataAdapter,
    columns: columns
    });`

    thanks in advance for any advice!

    Change Row style based in one cell #56756

    mikesantos
    Participant

    ps: sorry, I don’t know how to put this in code format

    Change Row style based in one cell #56764

    Dimitar
    Participant

    Hello mikesantos,

    Unfortunately, without knowing the grid’s id, you cannot access its other cells.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

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

You must be logged in to reply to this topic.