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
Problems using custom rowWriter with Markup.js, content ends up outside <tbody></tbody> #43
Comments
Interesting. Actually, now that I'm looking back at the code that appends the concatenated html string for the rows, it's pretty simple, but I'm wondering how it worked in the first place. All dynatable does is calls the Then, it removes all rows and appends the new concatenated rows string (lines 424-425): obj.$element.find(settings.table.bodyRowSelector).remove();
obj.$element.append(rows); Where If that's the case, then there must be something about the formatting of the Markup.js output string that doesn't trigger this magic in jQuery. I'm looking into this now to see if it can be easily fixed without causing the need for extra configuration when using dynatable on something other than a table (e.g. stylized list, etc.). |
FYI, I was able to reproduce this on JSFiddle without dynatable, just by appending the two strings from your gist to two tables with jQuery and looking at the resulting HTML. |
And, it looks like it's that initial |
Can you try the updated branch above and see if that fixes the issue for you? |
Thanks for the quick reply, that fixes the issue! |
Shouldn't this be closed? |
Yes, good point. |
Hi there.
I am experiencing a very odd problem trying to use Markup.js in my custom rowWriter.
My code works fine when just returning a string ala.
Using the code above in a custom rowWriter, like this, https://gist.github.com/flexd/427ac875d96735f2711c
It looks like this,
But, if I use Markup.js to generate the HTML string using the commented out code in the gist above, it looks like this:
As you can see in the second screenshot, the row has now somehow ended up outside
<tbody></tbody>
I am not sure why this happens, as you can see here https://gist.github.com/flexd/333768cabcb5f7462ae2
Both methods return proper HTML, the only difference is that the template is formatted to be readable.
Looking at the default rowWriter and the source code, I have not yet found out what may be causing this, but since Markup.js seems to return a perfectly good HTML string I believe the problem exists within dynatable at the moment, I may of course be wrong.
https://github.com/alfajango/jquery-dynatable/blob/master/jquery.dynatable.js#L373
I am on IRC for the next 4-5 hours today and a while during the day tomorrow (CET). :-)
The text was updated successfully, but these errors were encountered: