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
Custom HTML in filter-widget created tr? #311
Comments
Hi @Nadoedalo! I'm really not sure what you're asking. Do you want to add a new header custom header row? Did you want to use the filter input at all? Or just modify the contents of one cell? Maybe some code or something to help me conceptualize what you want would help. |
Sorry for not very clear message - its end of the day and english is not my native. And yes, hi @Mottie and everyone. I want to have my custom controls, like it was done for sorttable, but for filtering, and not in default place |
Don't worry about your English, you speak better than I can speak Ukrainian ;P If I understand what you are trying to do, I think you should try using the $('table').tablesorter({
theme: 'blackice',
widgets: ['zebra', 'filter'],
widgetOptions: {
// add custom filter elements to the filter row
filter_formatter: {
0: function ($cell, indx) {
$cell
.append('<button type="button">x</button>')
.find('button')
.on('click', function () {
alert("Header button has been clicked");
});
// no need to return reference to a hidden filter input
return $('<input type="hidden">');
}
}
}
})
// bind to the buttons within the table (using delegated events)
.find('tbody').on('click', 'button', function () {
alert("button inside the table clicked");
}); |
Yep, that thing is what I was looking for in my first post. |
What about this... it basically moves the entire filter row (demo). Although, you could probably do the same thing with a custom layout & use the new |
Thanks for your support, that is exactly what I was looking for, but seems its still not enough. |
Oops, I ended up updating the code I shared above with this new demo" http://jsfiddle.net/abkNM/766/ All I had to do was change I'm working on a new demo for you with external controls. |
Sorry, I forgot to mention that in v2.10.7 I added some beta-testing demos which include this one that sets up an external filter using the select2 plugin. I won't be able to followup on this for a few months, so hopefully that demo will show you how to resolve your issue. |
I'm guessing this issue has been resolved, so I'm going to close it. If you continue to have problems, please feel free to continue this discussion. |
Can I somehow add custom html in js-generated tr? Or disable that generation and use pre-generated filter inputs that will be just handled after initialize?
Basic thing that I want is to have mass delete records from row, that will be new collumn with 'Actions' label, the next - width actually actions and the data will go with checkboxes.
Have seen of how to change input to select, but I want to have set of my buttons instead, that will have actually no use for the filtering.
I know that I can replace content afterwards with js, but having more flexible tool is always better than having lots of fixes.
The text was updated successfully, but these errors were encountered: