Different menus for Editor New and Edit buttons.

Different menus for Editor New and Edit buttons.

A.obj.sys.incA.obj.sys.inc Posts: 14Questions: 7Answers: 4

When creating a new row for my table I do not need my user to enter all the fields of the table. Columns such as 'Active Date' are filled in by the server when the row is inserted into the database. On the other hand, Edit (update) should display almost all the fields except update date.

Therefore, is it possible to have a different menu for New and Edit.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    Yes - two options:

    1. Use the events initCreate and initEdit to show / hide fields (show() and hide())
    2. Use two different Editor instances. One for the create with the sub set of fields configured and another for the edit with the full set.

    Allan

  • A.obj.sys.incA.obj.sys.inc Posts: 14Questions: 7Answers: 4

    Thank you very much. I did not notice that where the buttons are associated with the editor that more that one editor object can be user.

        buttons : [ {
                extend : "create",
                editor : editor1
            }, {
                extend : "edit",
                editor : edito2r
            }, {
                extend : "remove",
                editor : editor3
            } ]
    
This discussion has been closed.