jQWidgets Forums

jQuery UI Widgets Forums Grid Row filter on rendered data

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 12 years, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Row filter on rendered data #19754

    hf
    Participant

    Hi,

    I would like to rowfilter on a (available) column which contains custom rendered values. The filtertype is checkedlist, but this checklist is filled with the original data (empty) and not with the data that comes out of the cellrenderer.

    COLUMNS:
    var columns = [
    { text: ‘Name’, datafield: ‘Name’, aggregates: [‘count’],
    aggregatesrenderer: function (aggregates, column, element, summaryData) {
    var renderstring = “

    “;
    $.each(aggregates, function (key, value) {
    renderstring += ‘

    Aantal regels ‘ + value + ‘

    ‘;
    });
    renderstring += “

    “;
    return renderstring;
    }
    },
    { text: ‘DirectoryName’, datafield: ‘DirectoryName’, editable: false, width: 350 },
    { text: ‘Available’, datafield: ‘Found’, filtertype: ‘checkedlist’, filteritems: [‘Yes’, ‘No’], editable: false, cellsrenderer: cellsrenderer, width: 350 }
    ]

    RENDERER:
    var cellsrenderer = function (row, columnfield, value, defaulthtml, columnproperties) {
    if (columnfield == ‘Found’) {
    Name = $(“#jqxgrid”).jqxGrid(‘getcellvalue’, row, ‘Name’);
    werkbonFile = Name.replace(“Werkbon “, “”).replace(“.pdf”, “”);

    found = -1
    $.map(arrayWerkbonnenFromDB, function (elementOfArray, indexInArray) {
    if (elementOfArray.werkbon == werkbonFile) {
    found += 1;
    }
    });

    if (found == -1) {
    result = ‘No’
    }
    else {
    result = ‘Yes’
    };

    var renderstring = “

    “;
    renderstring += ‘

    ‘ + result + ‘

    ‘;
    renderstring += “

    “;
    return renderstring;

    }
    };

    Regards

    Row filter on rendered data #19755

    Peter Stoev
    Keymaster

    Hi hf,

    You cannot fill the filter row with values that come from the cellsrenderer callback. To display custom items in the filter row, take a look at that approach: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/filterrowwithcustomitems.htm?web

    Best Regards,
    Peter Stoev

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

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

You must be logged in to reply to this topic.