question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Disable a Select2 control programmatically (from xyzDialog)

See original GitHub issue

Dear @volkanceylan, I’m trying to disable a Select2 control from the parent (I mean container) dialog, but with no luck. The same operation on a toolbar button was easy instead:

toolbar.FindButton("xyz-button").Hide();

but if I get a reference to the LookupEditor with the syntax form.MyLookupEditor then I cannot modify the enabled/disabled propery.

I also tried to get the control with the form.ById() syntax and then adding a readonly class, but once again it remain enabled…what I’m doing wrong?

Thanks for you support Regards

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
volkanceylancommented, Mar 16, 2016

EditorUtils.SetReadOnly(form.MyField, true)

0reactions
wldkrd1commented, Aug 10, 2016

Ahh, I had to rerun the T4 templates, the ts was out of date. Working now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to disable options in select2 - jquery
you can reinitialize select after disabling it use following code $("select").select2("destroy").select2();. something like
Read more >
Appearance | Select2 - The jQuery replacement for select ...
Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and pagination (infinite scrolling) of results.
Read more >
How to prevent two option value from being selected at the ...
I have one select2 element which has ajax data source. In my program I happen to set the value of one select2 element...
Read more >
Events | Select2 - The jQuery replacement for select boxes
You can manually trigger events on a Select2 control using the jQuery trigger method. However, if you want to pass some data to...
Read more >
Options | Select2 - The jQuery replacement for select boxes
Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and pagination (infinite scrolling) of results.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found