Skip to content

Commit 427ac2b

Browse files
committed
Boolean renderer using basic font awesome icons
* origin/pr/203: Boolean renderer using basic font awesome icons
2 parents 2fbd048 + ff983e0 commit 427ac2b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

assets/components/collections/js/mgr/extra/collections.renderers.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ collections.renderer.image = function(value, metaData, record, rowIndex, colInde
116116
return '<img src="' + MODx.config.base_url + imgPath + value + '" width="64">';
117117
}
118118
};
119+
collections.renderer.boolean = function(value, metaData, record, rowIndex, colIndex, store) {
120+
var iconclass = (value) ? 'icon-check' : 'icon-times';
121+
return '<div style="text-align:center;"><i class="icon ' + iconclass + '"></i></div>';
122+
};
119123

120124

121125
// Backwards compatibility
@@ -129,5 +133,6 @@ Collections.renderer = {
129133
datetimeTwoLines: collections.renderer.datetimeTwoLines,
130134
datetime: collections.renderer.datetime,
131135
timestampToDatetime: collections.renderer.timestampToDatetime,
132-
image: collections.renderer.image
136+
image: collections.renderer.image,
137+
boolean: collections.renderer.boolean
133138
};

core/components/collections/docs/changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Changelog for Collections.
22

3+
- Add collections.renderer.boolean renderer
34
- Add AjaxManager compatibility
45
- Adjust position of other columns when creating/updating column with position specified
56
- Add excludeResources option to getSelections snippet

0 commit comments

Comments
 (0)