Topic: Table Editor Plugin Best Practices
gkennedy free asked 6 years ago
Hi, I want to know if I'm using correctly the Table Editor Plugin:
1) I have a table with these fields: ID, name, updatedAt, createdAt
2) ID, updatedAt and createdAt are assigned by DB
3) I'm following the code in modalEditor.html that comes with the plugin
4) I modified this in modalEditor.html:
<div class="row d-flex justify-content-center modalWrapper">
<div class="modal fade addNewInputs" id="modalAdd" tabindex="-1" role="dialog" aria-labelledby="modalAdd"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header text-center">
<h4 class="modal-title w-100 font-weight-bold text-primary ml-5">Add Area</h4>
<button type="button" class="close text-primary" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body mx-3">
<div class="md-form mb-5">
<input type="text" id="inputName" class="form-control validate">
<label data-error="wrong" data-success="right" for="inputName">Name</label>
</div>
</div>
<div class="modal-footer d-flex justify-content-center buttonAddFormWrapper">
<button onclick="save()" class="btn btn-outline-primary btn-block">Save
<i class="fa fa-paper-plane-o ml-1"></i>
</button>
</div>
</div>
</div>
</div>
5)
function save() {
$.ajaxSetup({ headers:{ 'Authorization': "Bearer Wxyz...." } });
var name = document.getElementById("inputName").value;
$.post("/areas",
{name:name },
function(data, status) {
window.location.reload(true);
}
);
$('.close').click();
}
</div>
6) I had to reload the entire page in order to see te new record inserted, I couldn't find a better way to do it.
Do you have an example for this scenario or could comment the code in order to improve it?
Thank You
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Opened
- ForumUser: Free
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: MacBook Pro
- Browser: Google Chrome Version 70.0.3538.
- OS: macOS Mojave 10.14.1
- Provided sample code: No
- Provided link: No
Piotr Glejzer staff commented 6 years ago
Hi,
I respond in your last post. We don't have that example. We have only what you can see on our site. I put that task to improve that editor code and documentation. We are sorry again. Have a nice day.
Best,
Piotr