bufixed on json source
This commit is contained in:
24855
dist/app.js
vendored
24855
dist/app.js
vendored
File diff suppressed because one or more lines are too long
27
dist/app.js.LICENSE.txt
vendored
Normal file
27
dist/app.js.LICENSE.txt
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
/*!
|
||||
* Bootstrap v5.3.3 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Datepicker for Bootstrap v1.10.0 (https://github.com/uxsolutions/bootstrap-datepicker)
|
||||
*
|
||||
* Licensed under the Apache License v2.0 (https://www.apache.org/licenses/LICENSE-2.0)
|
||||
*/
|
||||
|
||||
/*!
|
||||
* jQuery JavaScript Library v3.7.1
|
||||
* https://jquery.com/
|
||||
*
|
||||
* Copyright OpenJS Foundation and other contributors
|
||||
* Released under the MIT license
|
||||
* https://jquery.org/license
|
||||
*
|
||||
* Date: 2023-08-28T13:37Z
|
||||
*/
|
||||
|
||||
/*! X-editable - v1.5.2
|
||||
* A maintained fork of x-editable for Bootstrap 5 support.
|
||||
* https://git.24unix.net/tracer/x-editable
|
||||
* Copyright (c) 2025 Micha Espey; Licensed MIT */
|
5412
dist/bootstrap5-editable/js/bootstrap-editable.js
vendored
5412
dist/bootstrap5-editable/js/bootstrap-editable.js
vendored
File diff suppressed because one or more lines are too long
10
dist/bootstrap5-editable/js/bootstrap-editable.js.LICENSE.txt
vendored
Normal file
10
dist/bootstrap5-editable/js/bootstrap-editable.js.LICENSE.txt
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
/*!
|
||||
* jQuery JavaScript Library v3.7.1
|
||||
* https://jquery.com/
|
||||
*
|
||||
* Copyright OpenJS Foundation and other contributors
|
||||
* Released under the MIT license
|
||||
* https://jquery.org/license
|
||||
*
|
||||
* Date: 2023-08-28T13:37Z
|
||||
*/
|
File diff suppressed because one or more lines are too long
10768
dist/jquery.js
vendored
10768
dist/jquery.js
vendored
File diff suppressed because one or more lines are too long
10
dist/jquery.js.LICENSE.txt
vendored
Normal file
10
dist/jquery.js.LICENSE.txt
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
/*!
|
||||
* jQuery JavaScript Library v3.7.1
|
||||
* https://jquery.com/
|
||||
*
|
||||
* Copyright OpenJS Foundation and other contributors
|
||||
* Released under the MIT license
|
||||
* https://jquery.org/license
|
||||
*
|
||||
* Date: 2023-08-28T13:37Z
|
||||
*/
|
@ -9,7 +9,6 @@ import $ from "jquery";
|
||||
//store parent methods
|
||||
const pInitInput = $.fn.editableform.Constructor.prototype.initInput;
|
||||
|
||||
console.log("EditableForm:", $.fn.editableform);
|
||||
$.extend($.fn.editableform.Constructor.prototype, {
|
||||
initTemplate: function() {
|
||||
this.$form = $($.fn.editableform.template);
|
||||
|
14
test.html
14
test.html
@ -19,13 +19,25 @@
|
||||
<form id="test-form" action="test.php" method="post">
|
||||
|
||||
<div class="container mb-3">
|
||||
<h3>Test X-Editable Yes/No Switch</h3>
|
||||
<h3>Test X-Editable Yes/No Switch - AJAX Source</h3>
|
||||
<p>Click on the text below to toggle Yes/No:</p>
|
||||
|
||||
<a
|
||||
href="#"
|
||||
id="yes-no-switch"
|
||||
class="editable editable-click"
|
||||
>
|
||||
Yes
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="container mb-3">
|
||||
<h3>Test X-Editable Static Source - JSON Source</h3>
|
||||
<p>Click on the text below (uses static array, not AJAX):</p>
|
||||
<a
|
||||
href="#"
|
||||
id="yes-no-switch-json"
|
||||
class="editable editable-click"
|
||||
data-type="select"
|
||||
data-pk="1"
|
||||
data-title="Select Yes/No"
|
||||
|
34
test.js
34
test.js
@ -15,16 +15,7 @@ const Editable = require("bootstrap5-editable/js/bootstrap-editable");
|
||||
console.log("Editable:", Editable);
|
||||
$.fn.editable.defaults.mode = 'inline';
|
||||
|
||||
// import("bootstrap5-editable/js/bootstrap-editable")
|
||||
// .then((module) => {
|
||||
// console.log("Loaded bootstrap-editable:", module);
|
||||
// console.log("Module exports:", Object.keys(module)); // Log what is actually exported
|
||||
// window.EditableForm = module.default || module;
|
||||
// console.log("Window.EditableForm:", window.EditableForm);
|
||||
// })
|
||||
// .catch((err) => console.error("Error loading module:", err));
|
||||
$(function() {
|
||||
console.log("hello world");
|
||||
|
||||
$('#yes-no-switch').editable({
|
||||
type: 'select',
|
||||
@ -38,6 +29,31 @@ $(function() {
|
||||
console.error("Save error:", response);
|
||||
}
|
||||
});
|
||||
console.log("Internal editable data:", $('#yes-no-switch').data('editable'));
|
||||
const ed = $('#yes-no-switch').data('editable');
|
||||
console.log("Internal editable data:", ed);
|
||||
if (ed) {
|
||||
console.log("TYPE:", ed.type, "OPTIONS:", ed.options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$('#yes-no-switch-json').editable({
|
||||
type: 'select',
|
||||
url: 'test.php', // URL to send the POST request
|
||||
source: [ // Static array instead of URL
|
||||
{value: 0, text: "No"},
|
||||
{value: 1, text: "Yes"},
|
||||
{value: 2, text: "Maybe"}
|
||||
],
|
||||
value: 1,
|
||||
success: function(response, newValue) {
|
||||
console.log("Static source saved successfully:", response);
|
||||
},
|
||||
error: function(response) {
|
||||
console.error("Static source save error:", response);
|
||||
}
|
||||
});
|
||||
|
||||
$('#datepicker').editable({
|
||||
type: 'date',
|
||||
|
Reference in New Issue
Block a user