Comments (3)
hi,
just checked - yes, for submit api method POST is hardcoded. I will definetly change it to be an option in next release.
As local solution you can use getValue
method to collect data from editables and submit them via ajax.
(see how it done here https://github.com/vitalets/x-editable/blob/master/src/element/editable-element.js#L418)
For individual submit it is already done in 1.1.1, have a look on #22
Thank you.
from x-editable.
What a quick answer! 👍
I've modified your code to use ajaxOptions in 'submit' : here what I've done :
(line 1425) case 'submit': //collects value, validate and submit to server for creating new record
var config = arguments[1] || {},
$elems = this,
errors = this.editable('validate'),
values, ajaxOptions; // added var ajaxOptions
if(typeof config.error !== 'function') {
config.error = function() {};
}
if($.isEmptyObject(errors)) {
values = this.editable('getValue');
if(config.data) {
$.extend(values, config.data);
}
ajaxOptions = $.extend({ //extending ajax options with config.ajaxOptions
url : config.url,
data : values,
type : 'POST',
dataType: 'json'
}, config.ajaxOptions);
$.ajax(ajaxOptions).success(function(response) {
from x-editable.
thanks, it is exactly what i need !
from x-editable.
Related Issues (20)
- bootstrap-editable.min.js:6 Uncaught TypeError: Cannot read property 'template' of undefined
- validate does not work with onblur submit
- bootstrap-switch plugin for x-editable HOT 1
- List limit for select fields?
- Bootstrap 4 support HOT 13
- editor window do not come up with HTTPS
- Its made issue while we adding data after Ajax call not working
- x-editable + select2 + ajax submit work with no results found in search box (or not click any item from list)
- Can't editable when data is json data in textarea data type
- Can not get x-editable to work with browserify, with or without browserify-shim
- Render html in checklists, instead of showing it as text
- Error loading list with select HOT 1
- success not working after enable is called
- X-Editable and select2 HOT 2
- I click on editable but it is not opening going above in the top
- Security Issue
- Bootstrap 5 support HOT 5
- Editable not working HOT 1
- [question] Select dblclick toggle
- Uncaught TypeError: Cannot use 'in' operator to search for 'value' in null
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from x-editable.