You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Everyone, I am new to this and so far I manage to run a jquery.bootgrid and data is displayed nicely with edit and delete buttons, however I am struggling to open a modal window and on.click of edit the select record.
Please can someone help.
here is my ajax.js script code. further down is a fetchrecord.php file, which i would like to display in a modal window with save and close button.
$(document).ready(function(){
var employeeTable = $('#employee_grid').bootgrid({
ajax: true,
rowSelect: true,
post: function()
{
return{
id: "b0df282a-0d67-40e5-8558-c9e93b7befed"
};
},
url: "fetch_data.php",
formatters: {
"commands": function(column, row)
{
return "<button type=\"button\" class=\"btn btn-xs btn-default command-edit\" data-row-id=\"" + row.emp_id + "\"><span class=\"glyphicon glyphicon-edit\"></span></button> " +
"<button type=\"button\" class=\"btn btn-xs btn-default command-delete\" data-row-id=\"" + row.emp_id + "\"><span class=\"glyphicon glyphicon-trash\"></span></button>";
}
}
});
// On load of document, pick row-id and perform crud operations.
// This is where I am having problems.
$(document).on("loaded.rs.jquery.bootgrid", function () {
//Remove event handlers
$(this).find(".command-edit").off();
$(this).find(".command-delete").off();
$(this).find(".command-add").off();
$(this).find(".command-edit").on("click", function (e) {
alert("You pressed edit on row: " + $(this).data("row-id"));
}).end().find(".command-delete").on("click", function (e) {
alert("You pressed delete on row: " + $(this).data("row-id"));
}).end().find(".command-add").on("click", function (e) {
/* Yout button logic */
});
});
});
Hi Everyone, I am new to this and so far I manage to run a jquery.bootgrid and data is displayed nicely with edit and delete buttons, however I am struggling to open a modal window and on.click of edit the select record.
Please can someone help.
here is my ajax.js script code. further down is a fetchrecord.php file, which i would like to display in a modal window with save and close button.
My php fetchsinglerecord.php code.
How do i get this record from fetchsingle.php in a modal window. Please helpl
The text was updated successfully, but these errors were encountered: