Editor: Hide field in form, but have it editable in table
Editor: Hide field in form, but have it editable in table
Hi there,
I am currently evaluating Editor and I am looking to see if it fits my use case.
I have a table which will display 13 columns: 3 with string values and the other 10 with numerical values. When the users add a new line in the table, through the form, I want them to define the 3 string columns only, while the other 10 to be edited/completed inline afterwards. And the opposite: those 3 string columns I want them to be edited only through the form and not inline.
If I want to hide the 10 numeric columns from the form, I could use the editor.hide() method on initEdit and initCreate events. However, if I do so, the columns will become hidden in the inline edit as well.
Is there a way to achieve this or something close to it, at least ?
Thanks!
Ionut
This question has an accepted answers - jump to answer
Answers
Hi Ionut,
I would suggest having two Editor instances on your table. Have one that is tied to a "Create" button and one that performs the inline editing. Define the fields as needed for each.
Regards,
Allan
Simple solution: Use two different Editors with the same Data Table. No problem. If your Data Table is ajax sourced all of the Editors would have the same url. I use up to four different Editors with the same Data Table.
The other option is to use the same Editor with the form and inline in parallel. You only limit the inline editable cells and of course you can also hide other fields dynamically in the form. That also works well.
This is an example of the latter with special inline form options:
and the activation for inline editing for special rows (not all rows) and special columns.
You see the "onBlur" option redundantly: That was due to a bug in Editor. Might be fixed by now.
Now if you want to exclude fields from form editing you can use this:
Hi rf1234,
Actually, this did the trick:
Thanks!