Refresh View Button
How to create a Refresh button that updates view data without needing to reload the page
Last updated
Was this helpful?
How to create a Refresh button that updates view data without needing to reload the page
Last updated
Was this helpful?
Was this helpful?
/***************************/
/*** Refresh View Button ***/
/***************************/
$(document).on("knack-view-render.view_321", function (event, page) {
var button = $(
"<span style='width: 2em'></span>" +
"<button id='refresh-view_321' style='border-radius: .35em' class='kn-button is-primary'>" +
"<i class='fa fa-refresh'></i>" +
"<span style='width: .5em'></span>Refresh Table</button>"
);
button.insertAfter(//places button next to keyword search option
$("#view_321").find("form.table-keyword-search").find("a")[0]
);
$("#refresh-view_321").click(function (e) {
e.preventdefault();
Knack.views["view_321"].model.fetch();
});
});view_2698