Skip to content

Commit ce54dfe

Browse files
authored
Merge pull request #82 from programcsharp/master-fixreferesh
Wrap response in table tag
2 parents 740524b + f56222e commit ce54dfe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Griddly/Scripts/griddly.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,16 +1196,16 @@
11961196
this.options.pageCount = Math.ceil(this.options.count / this.options.pageSize);
11971197
// TODO: handle smaller count
11981198

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

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

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

1207-
if (tfoot.length && html.is("tfoot"))
1208-
tfoot.replaceWith(html.filter("tfoot"));
1207+
if (tfoot.length && html.children("tfoot").length)
1208+
tfoot.replaceWith(html.children("tfoot"));
12091209

12101210
var startRecord = this.options.pageNumber * this.options.pageSize;
12111211
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);

0 commit comments

Comments
 (0)