tabalinas / jsgrid

Lightweight Grid jQuery Plugin
http://js-grid.com
MIT License
1.53k stars 353 forks source link

How can I call default rowRenderer from a custom rowRenderer ? #1398

Open gian-paolo opened 3 years ago

gian-paolo commented 3 years ago

Help Request/Question I would like to use custom rowRenderer only when the page width is less than a defined limit.

    rowRenderer: function(item) {
        if(screen.width < 800){
            customString = 'example';
            return $("<tr>").append($("<td>").append(customString);
        }else{
            //call default function
            return ...
        }
    },

Thank you

gian-paolo commented 3 years ago

I'm trying something like this: rowRenderer: function(item, itemIndex) { if(screen.width < 800){ //custom render }else{ //call default function $result = $("<tr>"); this._renderCells($result, item); return $result; } },