difference in the number of columns between creation and edition
difference in the number of columns between creation and edition
Hello,
I have for example 10 columns to display and I display them all.
Creation :
I would like during the creation of a line to fill these 10 columns with Datatables Editor.
BUT
Editing :
I wish I could edit only 4 of the 10 columns.
Is it possible to have this difference between creation and edition?
If yes how please?
By thanking you.
This discussion has been closed.
Replies
Use the
fields
configuration option in the Editor initialization to define the specific fields you want to edit. See thefields.data
docs for more info.Kevin
Thank you kthorngren for your answer.
Unfortunately I'm not a developer and I don't understand the example, do you have a simpler example for me to understand please?
Thanking you.
This example has four columns with two of them being editable.
http://live.datatables.net/guwafemu/94/edit
Kevin
I just saw the example and it's exactly like my problem:
Edit: 2 columns AND Create: 2 columns.
I would like to:
Edit: 2 columns. And Create: 4 columns.
Is it possible?
Sorry, misunderstood your question. Allan provides a few options in this thread.
Kevin
Thanks. Sounds like what I'm looking for,
to your knowledge is there an example online please?
Probably the easiest is to use two instances like this:
http://live.datatables.net/guwafemu/95/edit
Kevin
It's perfect,
Thank you very much.
I made the modification and it's working fine.
But with the "inline Editor" version the cell modification is not possible anymore, how to fix this problem please?
Thanks
Its hard to say without seeing what you have. You should be able to edit the fields you have defined with the editor instance. You have something similar to this to define the inline editor.
``js
// Activate an inline edit on click of a table cell
$('#example').on( 'click', 'tbody td:not(:first-child)', function (e) {
editor.inline( this );
} );
```
The
editor.inline( this );
will use the editor instance you defined in theeditor
(or whatever variable you have).Look in the browser's console for errors.
Kevin
Thanks for the lead, I replaced this
By
Thanks you.