Skip to content

Commit

Permalink
Boolean renderer using basic font awesome icons
Browse files Browse the repository at this point in the history
  • Loading branch information
sepiariver committed Jul 10, 2016
1 parent 2fbd048 commit ff983e0
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ collections.renderer.image = function(value, metaData, record, rowIndex, colInde
return '<img src="' + MODx.config.base_url + imgPath + value + '" width="64">';
}
};
collections.renderer.boolean = function(value, metaData, record, rowIndex, colIndex, store) {
var iconclass = (value) ? 'icon-check' : 'icon-times';
return '<div style="text-align:center;"><i class="icon ' + iconclass + '"></i></div>';
}


// Backwards compatibility
Expand All @@ -129,5 +133,6 @@ Collections.renderer = {
datetimeTwoLines: collections.renderer.datetimeTwoLines,
datetime: collections.renderer.datetime,
timestampToDatetime: collections.renderer.timestampToDatetime,
image: collections.renderer.image
};
image: collections.renderer.image,
boolean: collections.renderer.boolean
};

0 comments on commit ff983e0

Please sign in to comment.