Skip to content
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

Rebind cardtable? #51

Open
alkanegit opened this issue Feb 27, 2017 · 2 comments
Open

Rebind cardtable? #51

alkanegit opened this issue Feb 27, 2017 · 2 comments

Comments

@alkanegit
Copy link

Hi.

Is there a way to rebind cardtable?

On initial load I bind like so:
$('#searchresults').cardtable();

And on subsequent paging, I call the same again:
$('#searchresults').cardtable();

But the cardtable doesn't update the 'hidden' table? Any advice please?

@alkanegit
Copy link
Author

Fixed it:

//if ($table.hasClass('stacktable')) {
// return;
//}
//remove paged temp stackable
$(".pagedStackable").remove();

and i rebind after each page like so:
$('#searchresults').cardtable({ myClass: 'pagedStackable' });

@alkanegit
Copy link
Author

alkanegit commented Mar 1, 2017

Added another 'fix' too. If I have a blank row in my table (intentionally) I do not want the header key in my stacked table. So I put a class on the <tr> like so <tr class="blankkey">:

Then after
$table.find('>tbody>tr').each(function() {
I add
var trclassname = $(this).attr('class');

and i change this line:
if ($topRow.find('>td,>th').eq(cellIndex).html()){
to this
if ($topRow.find('>td,>th').eq(cellIndex).html() && trclassname != "blankkey"){

seems to work....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant