Commits

Anonymous committed 62e6ef3

Add data-onclick attr

Comments (0)

Files changed (2)

htraf/js/htraf.plugins.js

             });
         }
 
-        // link highlighting
+        // Convert table columns of named like_to_ into links when
+        // data values are of form link_name|link_href
         $el.find("th").each(function(i) {
                       
             if ( $(this).text().indexOf('link_to_') != -1 )
 })(jQuery);
 
 
-/* 
+
 
 // Misc functions
 
-// Convert table columns of named like_to_ into links when
-// data values are of form link_name|link_href
-function makeLinks(id)
-{
-    var table_selector = "#" + id;
-            
-    $(table_selector).find("th").each(function(i) {
-                  
-        if ( $(this).text().indexOf('link_to_') != -1 )
-        {
-            $(this).text($(this).text().substring($(this).text().indexOf('link_to_')+8));
-            selector = "td:nth-child("+(i+1)+")";
-            $(table_selector).find(selector).each(function(e) {
-                if ( $(this).text().indexOf('|') != -1 )
-                {
-                    $(this).html('<a href="'+$(this).text().substring($(this).text().indexOf('|')+1)+'">'+$(this).text().substring(0,$(this).text().indexOf('|'))+'</a>');
-                }
-            });
-        }
-    });
-
-}
 
 // hide column in tables
 function hideCol(id,col)
 // End add column totals to tables
 
 
-*/
+

htraf/js/htraf.widgets.js

         SERVER: 'data-server',
         HTSQL_PREFIX: 'data-htsql-prefix',
         CHANGE: 'change',
+        CLICK: 'click',
         BEFORELOAD: 'beforeload',
         AFTERLOAD: 'afterload',
         EMPTY: 'empty',
             this._trigger('change');
         }
         else
-            set.eq(0).click();
+            //set.eq(0).click();
+            self._select(set.eq(0).attr(attribute), this);
     }; 
     obj._select = function(id, item) {
         this._index = id;
         selected.eq(0).addClass(CSS_SELECTED);
 
         this._trigger('change');
+
     };
 
     obj.setValue = function(value) {
         this._setupSource();
 
         bindPlugin('pre');
-        this.element.bind([CHANGE, BEFORELOAD, AFTERLOAD, EMPTY].join(' '),
+        this.element.bind([CHANGE, CLICK, BEFORELOAD, AFTERLOAD, EMPTY].join(' '),
             function(e) {
                 var code = $(this).attr('data-on' + e.type);
                 if(!code)