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:
Micha
2025-07-28 12:48:43 +02:00
parent 46a32e3c20
commit 9d84a1f21d
19 changed files with 4766 additions and 20 deletions

View File

@@ -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);
// }
// });
})

View File

@@ -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>