Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Griddly/Scripts/griddly.js
Original file line number Diff line number Diff line change
Expand Up @@ -1194,16 +1194,16 @@
this.options.pageCount = Math.ceil(this.options.count / this.options.pageSize);
// TODO: handle smaller count

var html = $(data);
var html = $("<table>" + data + "</table>");

// replaceWith is more performant, but using inner html allows us to maintain the tbody element which is potentially important for some other libraries
// https://github.com/programcsharp/griddly/issues/79
this.$element.find("tbody.data").html(html.filter("tbody").html());
this.$element.find("tbody.data").html(html.children("tbody").html());

var tfoot = this.$element.find("tfoot");

if (tfoot.length && html.is("tfoot"))
tfoot.replaceWith(html.filter("tfoot"));
if (tfoot.length && html.children("tfoot").length)
tfoot.replaceWith(html.children("tfoot"));

var startRecord = this.options.pageNumber * this.options.pageSize;
this.$element.find(".griddly-summary").html('<span class="hidden-xs">Records</span> ' + (startRecord + (this.options.count ? 1 : 0)) + ' <span class="hidden-xs">through</span><span class="visible-xs">-</span> ' + (startRecord + currentPageSize) + " of " + this.options.count);
Expand Down