Restore select2 input functionality after Bootstrap 5 cleanup
- Restored select2 input type from earlier commit d4adf5e^ - Added select2 import to bootstrap5-editable.js bundle - Updated demo with select2 example (requires select2 library) - Enhanced README.md with comprehensive select2 documentation - Includes support for static sources, AJAX sources, and advanced configuration - Select2 library must be included separately (not bundled)
This commit is contained in:
26
demo/demo.js
26
demo/demo.js
@@ -70,4 +70,30 @@ $(function() {
|
||||
}
|
||||
});
|
||||
|
||||
// Note: This would require select2 library to be loaded
|
||||
// $('#select2-test').editable({
|
||||
// type: 'select2',
|
||||
// url: 'demo/demo.php',
|
||||
// source: [
|
||||
// {id: 'us', text: 'United States'},
|
||||
// {id: 'gb', text: 'Great Britain'},
|
||||
// {id: 'ru', text: 'Russia'},
|
||||
// {id: 'de', text: 'Germany'},
|
||||
// {id: 'fr', text: 'France'},
|
||||
// {id: 'es', text: 'Spain'},
|
||||
// {id: 'it', text: 'Italy'}
|
||||
// ],
|
||||
// value: 'us',
|
||||
// select2: {
|
||||
// placeholder: 'Select Country',
|
||||
// allowClear: true
|
||||
// },
|
||||
// success: function(response, newValue) {
|
||||
// console.log('Select2 success:', newValue);
|
||||
// },
|
||||
// error: function(response) {
|
||||
// console.log('Select2 error:', response);
|
||||
// }
|
||||
// });
|
||||
|
||||
})
|
||||
|
@@ -63,6 +63,22 @@
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<h3>Test X-Editable Select2</h3>
|
||||
<p>Click to select from a larger list with search (Note: Requires select2 library):</p>
|
||||
|
||||
<a
|
||||
href="#"
|
||||
id="select2-test"
|
||||
class="editable editable-click"
|
||||
data-type="select2"
|
||||
data-pk="104"
|
||||
data-title="Select Country"
|
||||
>
|
||||
Click to select country
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user