I'm not sure why, but the footable docs only show a method of getting data from a file, but not from a webservice, so i tried all sorts of combinations for getting data returned, in json format, into the footable instance, but no luck. Their example shows the following:
$('.table').footable({
"rows": $.get('rows.json')
});
(presuming the columns are already defined) and this works. However, in my ajax query, I tried
$('.table').footable({
"rows": data.d
});
and no errors happen, the data is in the correct format (verified with an online JSON schema checker), but nothing happens (no errors in the console).
The ajax query i tested thoroughly (works, and I can even parse the data.d returned), so I'm lost as how to proceed.
$.ajax({
type: "POST",
url: "/Search.asmx/GetListingsByPageSort",
data: '{"sp":' + JSON.stringify(sp) + '}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
$('.table').footable({
"rows": data.d
});
},
error: function (xhr, status) {
alert("fail: " + status);
}
});
The HTML is
<table class="table" data-paging="true">
<thead>
<tr>
<th class="hdrcolVdr" data-class="expand" data-type="html" data-name="vendor">Vendor </th>
<th class="hdrcolMan" data-breakpoints="xs sm" data-type="html" data-name="manufacturer">Manufacturer </th>
<th class="hdrcolProd" data-breakpoints="xs sm md" data-type="html" data-name="product_name">Product </th>
<th class="hdrcolPrice" data-breakpoints="xs" data-type="html" data-name="price">Price </th>
<th class="hdrcolI" data-breakpoints="xs sm" data-type="html">Info </th>
</tr>
</thead>
</table>
Stumped.