Ver Mensaje Individual
  #2 (permalink)  
Antiguo 18/08/2008, 11:56
Avatar de Un_Tico
Un_Tico
 
Fecha de Ingreso: julio-2008
Ubicación: Cartago, Costa Rica
Mensajes: 176
Antigüedad: 15 años, 10 meses
Puntos: 4
Respuesta: plugin Tablesorter de jquery+widget

Hola de nuevo, por lo visto nadie quizo entrarle a esto, bueno pues ya solucioné el problema, el link al demo está por aquí un tiempo, pero por aquello aquí está el codigo...

El css
Código HTML:
/**********RollOver Widget Css******/
table.tablesorter tr.hover td {
	background-color: #E0E0EF;
}
table.tablesorter tr.hover.even td {
	background-color: #E0E0EF; 
}
table.tablesorter tr.hover.odd td {
	background-color: #E0E0EF;
} 
table.tablesorter tr.selected td {
	background-color: #8DBDD8;
}
table.tablesorter tr.selected.even td {
	background-color: #8DBDD8;
}
table.tablesorter tr.selected.odd td {
	background-color: #8DBDD8;
}
table.tablesorter tr.selected.hover td {
	background-color: #B5D0DF;
} 
/**********End RollOver Widget Css****/
el widget:
Código HTML:
$.tablesorter.addWidget({
			id: "rollover",
			inited: false,
			index: false,
			format: function(table) {
				if(!this.inited) {
					var css = table.config.widgetRollOver.css;
					$("> tbody tr",table).mouseover(function() {
						var hasClass = $(this).is(table.config.widgetRollOver.css[0]);
						if (!hasClass) {
							$(this).addClass(table.config.widgetRollOver.css[0]);
						} 
					}).mouseout(function(){
						var hasClass = $(this).is(table.config.widgetRollOver.css[0]);
						if (!hasClass) {
							$(this).removeClass(table.config.widgetRollOver.css[0]);
						}
					}).click(function(){
						//try to find last selected tr row if you need it
						//$(this).parent().find('tr.' + css[1]).removeClass(css[1]);
						var hasClass = $(this).is(table.config.widgetRollOver.css[0]);
						if (!hasClass) {
							var is_selected = $(this).hasClass(table.config.widgetRollOver.css[1]);
							if(is_selected){
								$(this).removeClass(table.config.widgetRollOver.css[1]);
								//uncheck all checkboxes in the tr
								$(this).find("input[type='checkbox']").attr("checked","");
							}else{
								$(this).addClass(table.config.widgetRollOver.css[1]);
								//check all checkboxes in the tr
								$(this).find("input[type='checkbox']").attr("checked","checked");	
							}
						}
						this.index = $(this).index();
					});
					this.inited = true; 
				}
				if(this.index){
					$("> tbody tr",table).find('tr.' + table.config.widgetRollOver.css[1]).removeClass(table.config.widgetRollOver.css[1]).end().find('tr:eq(' + this.index + ')').addClass(table.config.widgetRollOver.css[1]);				
				} 
					
			}
		}); 
Saludos...