Topic: MDB Pro and Table editable plugin
Dear MDB Team,
Please excuse my bad English. :-(
I am interested for the package: MDB Pro incl. Table editable plugIn.
My DataSet is always an array. It is filled via PDO from a database or it comes from a REST server as JSON array. All records have a primary key. How is the PK field (dummy value) set for an insert? Is there an example?
A second question: I would like to enter a new invoice item via a table inline edititing. If I enter a valid article number, the name and the price should be entered in the table via an AJAX call. If the article number is not unique, a modal dialog with an article table should be available for selection. How could this be implemented? Is there an example for this?
I assume there is a submit event by getting the modified array so I can write it back to my database.
regards,
Kostas
MDBootstrap staff pro premium priority answered 6 years ago
Hi!
You can find example of inserting values with js there https://mdbootstrap.com/plugins/jquery/table-editor/#modal-options
To check if certain value already exist you can create array of cells content in a column you chose by iterating over whole "data" to check it with jQ method $.inArray(valueYouWantToInsert, createdArrayOfExistingValues).
I am very sorry if I misunderstood any of your questions. I will gladly help if my answer is not enough.
Best Regards, Piotr
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Free
- Premium support: No
- Technology: MDB jQuery
- MDB Version: 4.8.0
- Device: PC
- Browser: Chrome
- OS: windows 10
- Provided sample code: No
- Provided link: No