Skip to content

Commit

Permalink
Boolean renderer using basic font awesome icons
Browse files Browse the repository at this point in the history
* origin/pr/203:
  Boolean renderer using basic font awesome icons
  • Loading branch information
theboxer committed Aug 1, 2016
2 parents 2fbd048 + ff983e0 commit 427ac2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
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
};
1 change: 1 addition & 0 deletions core/components/collections/docs/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Changelog for Collections.

- Add collections.renderer.boolean renderer
- Add AjaxManager compatibility
- Adjust position of other columns when creating/updating column with position specified
- Add excludeResources option to getSelections snippet
Expand Down

0 comments on commit 427ac2b

Please sign in to comment.