select options

select options

Andreas S.Andreas S. Posts: 169Questions: 58Answers: 4

I have two select inputs with same options, but different usages. For example the nationality of a person and the nation of his residence. At the moment the server send the options twice with different naming. Is it possible that both select fields (different names) take the same options that i send in the json?


This question has an accepted answers - jump to answer


  • colincolin Posts: 9,077Questions: 0Answers: 1,520

    That would be possible. You could have them declared as empt select in the initialisation, then in the preOpen you could add those values to the select with e-ai field().udate() if they haven't been done so already,


  • Andreas S.Andreas S. Posts: 169Questions: 58Answers: 4

    Did not understand how can i get those data
    from the json file?

  • Andreas S.Andreas S. Posts: 169Questions: 58Answers: 4
    Answer ✓

    I have found with try and error this:

    aedit.on( 'preOpen open', function( e, mode, action ) {
            if( 'preOpen' == e.type ) {
                aedit.field('znation').update( paathlete.context[0].json.options.nation );
            if( 'open' == e.type ) {
                $( '#none' ).removeClass( 'd-none' );
        } );

    but the need 3 seconds before the editor open with one of this update. if i add a second select with this code the time grow up to 5 seconds.


  • allanallan Posts: 51,954Questions: 1Answers: 7,882 Site admin
    edited January 27

    Sounds like you might have a lot of options. You might want to consider using Select2 or similar to show and filter just a subset of options.


Sign In or Register to comment.