2

I would like to move "click heading to sort" to "double click heading to sort". So currently i'm doing it with the following two lines:

table.unsubscribe("theadCellClickEvent", TAG.content.table.onEventSortColumn);
table.subscribe("theadCellDblclickEvent", TAG.content.table.onEventSortColumn);

However, when i do this, and i click on the heading, it will take me to folder/thead-id (since by default there is a "a" tag wrapped around the heading text.

Any idea how to do it properly?

Thanks a lot!

Jason

FurtiveFelon
  • 14,714
  • 27
  • 76
  • 97

1 Answers1

2

You have to stop the default click event. Create a new event handler for the click event that simply stops bubbling the event.

    var stopEvent = function(oArgs) {
        var evt = oArgs.event;
        YAHOO.util.Event.stopEvent(evt);
    };

    table.unsubscribe("theadCellClickEvent", TAG.content.table.onEventSortColumn);
    table.subscribe("theadCellClickEvent", stopEvent);
    table.subscribe("theadCellDblclickEvent", TAG.content.table.onEventSortColumn);
Matthew Smith
  • 1,287
  • 1
  • 9
  • 19