Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Select2 initialize duplicate component


Hi,
I've updated my project from 2.1.1 to 3.0.6.
I use select2 component as below
@Html.DropDownListFor(model => model.FirmId, new SelectList((System.Collections.IEnumerable)ViewBag.firmList, "Value", "Text"),
new { @id = "FirmSelect", @class = "form-select form-select-sm form-select-solid", @data_control = "select2", @style = "width:250px;", @onchange = "SelectFirm()", @required = "required" })

This creates 2 diffrent select2 component. One of them regular and works perfect. The other is duplicate and has no options and only a placeholder shown as "Select".
Why does it duplicates component.

I've updated my project according to Update Guidlines at https://preview.keenthemes.com/html/keen/docs/getting-started/updates

I have one more project that updated from 3.0.5 to 3.0.6 which works great.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


Yep, you've got the point. happy I was looking for the second code that initializes... Finally found it. Thanks.



Hi happy,

Great! if you need any further help please do let us know.
All the best with your project!

Regards.


Your Support Matters!

We will highly appreciate your Metronic Review on Themeforest.
Please go to Themeforest Downloads page, select Metronic & leave your feedback.

Hi,

Could you please provide us with your test link? Probably you have 2 codes that initializes select2 twice. Please double check your code and make sure you remove Keen v2-related code that initializes Select2.

Regards.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(