summaryrefslogtreecommitdiffstats
path: root/install/ui/widget.js
diff options
context:
space:
mode:
Diffstat (limited to 'install/ui/widget.js')
-rw-r--r--install/ui/widget.js34
1 files changed, 24 insertions, 10 deletions
diff --git a/install/ui/widget.js b/install/ui/widget.js
index 1af9fd839..3e31b4c4a 100644
--- a/install/ui/widget.js
+++ b/install/ui/widget.js
@@ -1014,39 +1014,53 @@ IPA.column = function (spec) {
that.name = spec.name;
that.label = spec.label;
- that.primary_key = spec.primary_key;
that.width = spec.width;
+
that.entity_name = spec.entity_name;
- that.format = spec.format;
+ that.primary_key = spec.primary_key;
+ that.link = spec.link;
- that.setup = spec.setup || setup;
+ that.format = spec.format;
that.init = function() {
if (that.entity_name && !that.label) {
var param_info = IPA.get_entity_param(that.entity_name, that.name);
if (param_info) {
that.label = param_info.label;
- }else{
+ } else {
alert('cannot find label for ' + that.entity_name + ' ' +
that.name);
}
}
};
- function setup(container, record) {
-
+ that.setup = function(container, record) {
container.empty();
var value = record[that.name];
- if (that.format && value){
+ if (that.format && value) {
value = that.format(value);
}
-
value = value ? value.toString() : '';
+ if (that.link) {
+ $('<a/>', {
+ href: '#'+value,
+ html: value,
+ click: function() {
+ return that.link_handler(value);
+ }
+ }).appendTo(container);
+
+ } else {
+ container.append(value);
+ }
+
+ };
- container.append(value);
- }
+ that.link_handler = function(value) {
+ return false;
+ };
return that;
};