Select2 Disable is not working as expected...
Select2 Disable is not working as expected...
kaustubh.agrawal2000
Posts: 88Questions: 39Answers: 2
in Editor
I am using select2 plugin, although it works well, I have a use case where i should disable option select during edits.
which I am doing like:
editor.on( 'initEdit', function ( e, json, data ) {
editor.disable('commodity_id');
editor.disable('transaction_type');
});
Here, commodity_id & transaction_type are both select2 fields.. values of which are populated by AJAX.
The fields on the form are shown as GREYED OUT (like disabled).. but I am still able to select the options...
How can I disable that ?
Regards
Kaustubh
This discussion has been closed.
Answers
Hi,
I've just tried that locally and it appears to work as expected. Could you check that the version of the Select2 plug-in for Editor has:
in it, and also that you are using an up to date version of Select2 please?
If that doesn't resolve it, please link to a test case showing the issue.
Thanks,
Allan
Hi Allan..
The issue is still not resolved... Please find the details as below
Code details
Datatables: https://gadhiya.in/web/js/builder/datatables.min.js
Select2 : https://gadhiya.in/web/js/builder/select2.min.js
Plugin code: https://gadhiya.in/web/js/builder/custom.plugin.js
Kindly let me know what to change...
Thanks..
Can you update your Select2 version please? You are using 4.0.2 at the moment, they have a 4.0.6-rc.1 available (or 4.0.5 for the last stable).
Thanks,
Allan
Hi Allan..
I have updated the select2 lib. but still same thing is happening...
Please have a look at the websit I mentioned.
Any help would be greatly appriciated.
@allan any updates on this one... ??