How can I trigger a Bootstrap Modal that is located in a partial view within a controller using jQuery-Ajax and Bootgrid's JavaScript?
var grid = $("#grid").bootgrid({
ajax: true,
url: "/Currency/listCurrencyJson",
formatters: {
"commands": function(column, row) {
return "<button type=\"button\" class=\"btn btn-default btn-lg delete\" data-row-id=\"" + row.id + "\"><span class=\"glyphicon glyphicon-star\" aria-hidden=\"true\"></span> Star</button>" +
"<button type=\"button\" class=\"btn btn-xs btn-default command-edit\" data-row-id=\"" + row.id + "\"><span class=\"fa fa-pencil\"></span></button> " +
"<button type=\"button\" class=\"btn btn-xs btn-default command-delete\" data-row-id=\"" + row.id + "\"><span class=\"fa fa-trash-o\"></span></button>";
}
}
}).on("loaded.rs.jquery.bootgrid", function() {
/* Executes after data is loaded and rendered */
grid.find(".command-edit").on("click", function(e) {
alert("You pressed edit on row: " + $(this).data("row-id"));
}).end().find(".delete").on("click", function deleteCurrency(id) {
$.ajax({
url: '/Currency/createCurrency',
type: "POST",
data: { "row-id": "row-id" },
success: function() {
//alert("Done");
}
});
});
});