X-editable has no limitation to backend side, you can write it on any server language you prefer.
The common logic is:
pk
, name
and value
from request (POST by default).The most possible reason is that you have empty pk
or url
options.
If you want to submit data without pk please set send
option to "always"
.
Also form is not submitted if you did not change value. To manage this behavior see savenochange
option.
You may define params
as function:
$('#field').editable({ ... params: function(params) { //params already contain `name`, `value` and `pk` var data = {}; data['id'] = params.pk; data[params.name] = params.value; return data; } });
You may define params
as function and make conversion there:
//submit in JSON format $('#field').editable({ ... params: function(params) { return JSON.stringify(params); //note: for older browsers you may need json2.js from json.org } });
Overwrite css classes, e.g.
a.editable-click { color: green; border-color: green; } a.editable-click.editable-disabled { color: black; border-bottom: none; } a.editable-empty color: gray; font-style: italic; }
To create new input type (widget) just have a look on sources in inputs directory.
All inputs a derived from abstract.js
, code is commented.
I'm very often asked how to create complex widgets like address input:
Please consider, that x-editable main power is quick edit of single value that is stored in single database field.
If you want to have full featured form with several fields, just render it in hidden DIV and display by click. You don't need x-editable for that.
All your ideas and feedback are very appreciated! Please feel free to open issues on github or send me email.
I'm also grateful for your donations:
or via Gtitip:
Thank you!
List of donators: