allow string based values for comboboxarray
[roojs1] / Roo / bootstrap / Link.js
index 1fb10ad..13c17db 100644 (file)
@@ -15,6 +15,7 @@
  * @cfg {String} target (_self|_blank|_parent|_top) target for a href.
  * @cfg {String} html the content of the link.
  * @cfg {String} anchor name for the anchor link
+ * @cfg {String} fa - favicon
 
  * @cfg {Boolean} preventDefault (true | false) default false
 
@@ -45,22 +46,27 @@ Roo.extend(Roo.bootstrap.Link, Roo.bootstrap.Component,  {
     preventDefault: false,
     anchor : false,
     alt : false,
+    fa: false,
+
 
     getAutoCreate : function()
     {
+        var html = this.html || '';
         
-        var cfg = {
-            tag: 'a',
-        
+        if (this.fa !== false) {
+            html = '<i class="fa fa-' + this.fa + '"></i>';
         }
+        var cfg = {
+            tag: 'a'
+        };
         // anchor's do not require html/href...
         if (this.anchor === false) {
-            cfg.html = this.html || 'html-missing';
+            cfg.html = html;
             cfg.href = this.href || '#';
         } else {
             cfg.name = this.anchor;
-            if (this.html !== false) {
-                cfg.html = this.html;
+            if (this.html !== false || this.fa !== false) {
+                cfg.html = html;
             }
             if (this.href !== false) {
                 cfg.href = this.href;
@@ -72,7 +78,7 @@ Roo.extend(Roo.bootstrap.Link, Roo.bootstrap.Component,  {
         }
         
         
-        if(this.target) !== false) {
+        if(this.target !== false) {
             cfg.target = this.target;
         }