jQuery UI Widgets Forums Grid Grid Columns CellRenderer Method Broken in 3.8

This topic contains 1 reply, has 2 voices, and was last updated by  ivailo 9 years, 4 months ago.

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

  • David
    Participant

    I have a grid with a column that uses the cellrenderer callback method to draw a button. Here is the code:

    $("#MyGrid").jqxGrid({
        width: '100%',
        source: dataAdapter,
        autoheight: true,
        pageable: true,
        sortable: true,
        filterable: true,
        columnsmenu: false,
        showfilterrow: true,
        columns: [
            { text: 'Company', datafield: 'COMPANY', width: '10%', filtertype: 'input' },
            { text: 'Name', datafield: 'CONTACT_NAME', width: '15%', filtertype: 'input' },
            { text: 'Email', datafield: 'EMAIL', width: '20%', filtertype: 'input' },
            { text: 'Phone', datafield: 'PHONE', width: '10%', sortable: false, filtertype: 'input' },
            { text: 'Requested', datafield: 'REQUESTED', width: '35%', sortable: false, filtertype: 'input' },
            { text: 'Thank You', datafield: 'THANK_YOU_TYPE', width: '5%', filtertype: 'list' },
            {
                text: 'Edit',
                width: '2%',
                align: 'center',
                filterable: false,
                sortable: false,
                cellsrenderer: function (row, columnfield, value, defaulthtml, columnproperties) {
                    return glyphiconGridButton('edit-prospect', 'Edit', 'pencil', row);
                }
            },
            {
                text: 'Delete',
                width: '3%',
                align: 'center',
                filterable: false,
                sortable: false,
                cellsrenderer: function (row, columnfield, value, defaulthtml, columnproperties) {
                    return glyphiconGridButton('delete-prospect', 'Delete', 'trash', row);
                }
            }
        ]
    });
    
    function glyphiconGridButton(cssclass, label, image, id) {
        return '<div style="width: 100%; text-align: center; padding-top: 2px;">' +
            '<button class="btn btn-default btn-xs jqxgrid-button ' + cssclass + '" aria-label="' + label + '" data-id="' + id + '">' +
            '<span class="glyphicon glyphicon-' + image + '" aria-hidden="true"></span>' +
            '<span class="sr-only">' + label + '</span>' +
            '</button>' +
            '</div>';
    }

    The grid display correctly using version 3.7.1. When I upgraded to 3.8 the buttons were not longer appearing. I added an alert statement in the glyphiconGridButton function to make sure it was still being called and it was. For some reason the html returned from the cellrenderer method is no longer being added to the cell.


    ivailo
    Participant

    Hi David,

    I tested your cellsrendered with version 3.8.0 and it works well.
    You can see at this fiddle.
    Try to verify the path to the related Bootstrap and jqWidgets files.

    Best Regards,
    Ivailo Ivanov

    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.