How could I only add a field in Edit?

How could I only add a field in Edit?

liutongweiliutongwei Posts: 4Questions: 2Answers: 1

I'm trying to add a field in Edit and this field would not be shown in Create. But error is reported on the code below. How could I solve this problem?

editor.edit( true ).add( 'CstID' );
editor.field( 'CstID' ).label( "CstID :" ).fieldInfo( 'Inpu ID' );

Would be great if your answer has some code!

This question has an accepted answers - jump to answer

Answers

  • Tester2017Tester2017 Posts: 145Questions: 23Answers: 17
    edited October 2017 Answer ✓

    I think I understand your question, but maybe I am completely wrong ;).

    It looks like you want to show the ID of a row in the edit session, but not in the create session as it is not available before creation. Right?

    Ok then you can use the events of Editor like this:
    editor.on('initEdit', function(e, type)
    which is triggered when you are opening an edit session. Probably you declared your "CstID" as 'hidden' in Editor. Well then when you open the Editor for Edit you need to remove the hidden element.

    editor.on('initEdit', function(e, type) { $('#DTE_Field_groups-memo').removeClass('hidden'); });
    Or you can show it as read-only, as normally you would not change an iD (unless you have something to hide :)).

  • liutongweiliutongwei Posts: 4Questions: 2Answers: 1

    Thank you so much. This method is what I need! Appreciate your time ~

This discussion has been closed.