Create row inline with an unique form field
Create row inline with an unique form field
I'm looking for a way to inline create a new table row but I just want to set a value for the first cell and complete other fields with my code.
Is it possible to handle it with DataTables Editor?
$(tableId).on('click', 'thead th.row-create', function () {
editor.inlineCreate(table.cells(this.parentNode, '*').nodes()) // Here, I want to edit only the first cell
})
Thanks for your answers!
Replies
Thank you for your question about Editor, but our accounts aren't showing that you have a license - it just reports that your trial expired. Is the license registered to another email address? Please can let us know so we can update our records and provide support.
Thanks,
Colin
Hi,
The license was purchased by my client. With this email address, I suppose : <snip>
Hi,
It's N0tChris again but I'm now connected with my client account who purchased the licence.
Can you give me a support with my problem?
Thanks for that info!
You could do something like this here - see the "New inline" button. It's based on this example, but once the row has been created it fills in the "Position" field. Does that do the trick?
Colin
Thank you for your answer!
Unfortunately, this example doesn't fill my needs because I find an other way to auto-complete my fields (with preCreate event).
Now, I just want to don't let the possibility to users to edit other fields than "title", like "start date" field in your example.
To illustrate my words, here is a screenshot which show my table when I inline create a row :
On this screenshot, I don't want the user can edit the comment field (the second one) but only the title filed (the first one).
Thanks again for your precious help!
You can call
field().disable()
to make it read-only - see my earlier example updated here: http://live.datatables.net/puvoyalo/2/editColin
Thanks for your answer Colin!
It fits perfectly my needs!