i made several table-based-widgets (listview-kind-of) which all have the same characteristics: styling odd/even rows, hover on/off, set color onClick, deleting a row when clicking on trash-icon.
so it s always the same (prototype-)code for each widget. is there a way to have the code only once then simply apply/inherit it to all widgets?
2nd, here s some of the code - could this be optimized?
var me = this;
$("tr",this.table).each(function(i)
{
var tr = $(this);
tr.bind("mouseover",function(){me.hover(tr,true)});
tr.bind("mouseout",function(){me.hover(tr,false)});
tr.bind("click",function(){me.Click(tr)});
});
$("tr").filter(":odd").addClass("odd");