vitalets / x-editable

In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
http://vitalets.github.io/x-editable
MIT License
6.51k stars 1.72k forks source link

X-Editable and select2 #1172

Open Makistos opened 3 years ago

Makistos commented 3 years ago

I seem unable to get X-Editable to work nicely with select2. I can get X-Editable to work with other fields and select2 works on its own, but combining them seems cumbersome. Examples don't seem to work and include things that have been deprecated in select2 a long time ago (initSelection).

At least some of the issues I have:

  1. I can get an initial value to the field but when I click it the field empties. So I
  2. I can't figure out what my (Flask) backend is supposed to return because it seems no matter what I return component keeps telling nothing is found. I have verified my backend function does indeed return something but apparently in the wrong format. I've tried several different options.
  3. Default width of the component is 30px for some reason, only way I could figure how to fix this is by adding this as a parameter. This is ugly and not needed when using select2 alone.
  4. Save function is never seems to be called after I click the submit button.
  5. Are there any examples on how to use select2 with the multiple choice option (again, what format should I use?) and tags = true? Should the latter work like with how select2 normally does, i.e. with the createTag callback?
mkamensky commented 3 years ago

I use it with the 3.5.4 version of select2. It seems that it broke when passing to version 4

xxl4 commented 1 year ago

image

image

This code is work for my online project, Laravel Admin