Select2 4.0.0 ajax

Select2 4.0.0 ajax

cybersapiencybersapien Posts: 7Questions: 1Answers: 0

hi!

i'm using the select2 plugin with remote data sources using AJAX requests
when editing a row, the plugin couldn't initialize the field with the stored data value
this is how i fixed the problem

set: function ( conf, val ) {

  // old
  //conf._input.select2( 'val', val );

  // new
  _fieldTypes.select2._addOptions( conf, [val] );
  $(conf._input).trigger('change');

}

Replies

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

    Thanks for posting this - I'll look into what is going wrong with the plug-in as it stands and make the changes you suggest.

    Regards,
    Allan

  • tomduketomduke Posts: 9Questions: 1Answers: 0

    Hi,

    This solved a problem for me tonight! So thanks cybersapien.

    • Tom
This discussion has been closed.