This works for me:
$remote.select2('data', {id: null, text: null})
It also works with jQuery validate when you clear it that way.
—
edit 2013-04-09
At the time of writing this response, it was the only way. With recent patches, a proper and better way is now available.
$remote.select2('data', null)
Related Contents:
- How to set selected value of jQuery Select2?
- Is there a properly tested alternative to Select2 or Chosen? [closed]
- How to get Selected Text from select2 when using
- Tagging with AJAX in select2
- Select2() is not a function
- Select2 Ajax Method Not Selecting
- JQuery select2 set default value from an option in list?
- How to clean completely select2 control?
- Using Select2 get error – “Error: No select2/compat/query”
- Select2 limit number of tags
- Select2 not calculating `resolved` width correctly if select is hidden
- Select2 open dropdown on focus
- Select2 deselect all values
- Changing the image source using jQuery
- What’s the difference between ‘$(this)’ and ‘this’?
- Replace multiple characters in one replace call
- Can’t append element
- Difference between val() and text()
- Uncaught TypeError: Cannot read property ‘msie’ of undefined – jQuery tools
- How to find index of all occurrences of element in array?
- Format a JavaScript string using placeholders and an object of substitutions?
- How can I get selector from jQuery object
- How do I use jQuery’s form.serialize but exclude empty fields
- How to make tinymce paste in plain text by default
- Remove all multiple spaces in Javascript and replace with single space [duplicate]
- Convert returned JSON Object Properties to (lower first) camelCase
- How to silently hide “Image not found” icon when src source image is not found
- How to Automatically Close Alerts using Twitter Bootstrap
- jquery get all input from specific form
- jQuery bind to Paste Event, how to get the content of the paste
- Opposite of append in jQuery
- Google Maps API v3 infowindow close event/callback?
- milliseconds to time in javascript
- Using the Javascript slice() method with no arguments
- How to handle in textarea?
- JQuery Slider, how to make “step” size change
- How to structure my javascript/jquery code?
- How to check whether multiple values exist within an Javascript array
- Modify Twitter Bootstrap collapse plugin to keep accordions open
- Clean way to remove element from javascript array (with jQuery, coffeescript)
- Sort Array Elements (string with numbers), natural sort
- Equivalent of ASP’s .Contains method [duplicate]
- call a function in success of datatable ajax call
- Jquery/JS prevent right click menu in browsers
- Count textarea characters
- Attaching ‘onclick’ event to D3 chart background
- Javascript – ERR_CONTENT_LENGTH_MISMATCH
- JavaScript or jQuery browser back button click detector
- Find the “potential” width of a hidden element
- Close Bootstrap modal on form submit