-
Notifications
You must be signed in to change notification settings - Fork 755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onRenderHeader not applied to sticky headers #641
Comments
I am not familiar with onRenderHeaders, could you post how you apply it to the normal headers? And in which order you apply things? aka ts then onRenderHeaders or the other way? |
It's first applied when initializing tablesorter for my table and it works great until I scroll with stickyheaders. I noticed when my tables got longer with sticky headers that anything I modified in there wasn't applied. That's why I added the workaround above where I apply the code for onRenderHeader to the sticky headers. I found the following post on stackoverflow that outlined what I'm doing awhile ago. Basically I wanted to stop sorting and customize events within the headers. It looks like bindEvents is applied in the jquery.tablesorter.widgets.js but onRenderHeaders was not applied. http://stackoverflow.com/questions/11117662/jquery-table-sorter-stop-sorting $("#" + tableId).tablesorter(
theme: "jui",
headerTemplate: '{content} {icon}', // needed to add icon for jui theme
showProcessing: false,
widgets: widgetsAry,
widgetOptions: {
stickyHeaders: "tablesorter-stickyHeader",
filter_external: '#inpFilterColumnSearch',
filter_columnFilters: false,
filter_saveFilters: false,
scroller_jumpToHeader: false
},
onRenderHeader: function (index) {
var $this = $(this);
$this.find('SPAN.usergroup-add')
.mouseup(function () {
var targetID, paramAry = [];
if (updatePriv) {
targetID = $(this).attr("id");
if (targetID !== "" && targetID !== undefined) {
paramAry = targetID.split("-");
}
prsnlSearch(paramAry[0], paramAry[1]);
}
return false;
});
}); |
Hi @dmgerdes! Yeah, this is a difficult call... the stickyHeaders widget is initialized after the table headers have rendered. The stickyHeaders widget clones the HTML but not the events associated with the header, but it does bind same sorting functions to the sticky header as those applied to the original header. The problem is that the So as I see it, there are three solutions:
I think I will modify the stickyHeaders widget to work as stated in the first solution; but I probably won't be able to get around to coding it for a while. |
The stickyHeaders widget now uses the |
I use onRenderHeader to add eventhandlers to custom icons in the header so that I can prevent the header from sorting if I click inside of a header. However it looks like that when sticky headers are applied the onRenderHeader object is not copied to the stickyheaders table. I have to add the following code at the end to mimic the same functionality i get when my page is scrolled to the top.
The text was updated successfully, but these errors were encountered: