Comments (10)
I woudl rather leave the choice of namespacing or not to the developer. You can call with Jeditable with:
$('div').editable('http://www.example.com/save.php' {
event: 'click.editable'
});
However I agree the default event should be namespaced. Will fix. Thanks for the heads up!
from jquery_jeditable.
Fixed in Git.
from jquery_jeditable.
Hi I'm having trouble trying to figure out WHEN to destroy the jEditable instance.
I tried onblur but that prevented the controls from being removed.
from jquery_jeditable.
what i currently have is
function comment_edit() {
var obj = $(this);
var id = obj.attr('id').split('-')[2];
var options = {
onblur: function() {
$('#comment-' + id + ' .comment-body').reset().editable('destroy');
}
}
$('#comment-' + id + ' .comment-body').editable('http://www.example.com/save.php', options).trigger('click');
}
Which doesn't seem to work. I believe I need some way to reset() the form elements first.
from jquery_jeditable.
What are you trying to achieve? Why do you want to destroy Jeditable onblur?
from jquery_jeditable.
sorry I didnt explain myself.
i have an "edit" button which begins the editing process on another element (hence, the trigger).
when i am done editing (accept using the submit button), i want the edit ability to be removed.
i used onblur, but i changed it to be onreset and it is working fine now.
thanks!
from jquery_jeditable.
You do not need to do this by yourself. Jeditable goes back to normal (removes the form displays the new HTML) automatically after you click submit.
from jquery_jeditable.
yeah but the element becomes editable if i click on it
this is not something I want because I have links on it, and if i click on the link the edit form appears
from jquery_jeditable.
I guess you have some misunderstanding how Jeditable works. I say again. Jeditable closes the form and goes back to HTML automatically. You do NOT need to do it by yourself.
Also the way you trigger Jeditable inside comment_edit() function is quite unorthodox and un-jQuery way. Atleast to me.
More jQuerish would be binding Jeditable and trigger element on onload event. You can also bind using some custom event such as "edit" or "foo". Then when your trigger element is clicked just call .trigger("foo") on the edited element. This way when the edited element is clicked it will not become a form.
Here is one example: http://stackoverflow.com/questions/366595/jeditable-activate-edit-of-x-by-clicking-on-y
from jquery_jeditable.
No no, I do understand how it works, but as you said I am using it differently.
Thanks for that example, its exactly what I was after!
from jquery_jeditable.
Related Issues (20)
- How to turn off all Jeditable fields HOT 12
- Preempt editable sending value to the server if value is the same as the current value HOT 16
- Right Click, Double Click, Left Click ... all options to select from a Dropdown List HOT 1
- 2.0.18 - missing from changelog HOT 1
- not getting data from submitdata in jeditable HOT 1
- Select - Default value by current value selected HOT 4
- Data-driving select won't open and it scrolls to the top of the page HOT 3
- JS-Injection and PHP error on Live Demo https://jeditable.elabftw.net/ HOT 1
- How do we catch the "id" of the edited control when submitting to a custom function? HOT 7
- SELECT elements cannot be customized via the 'class'/'style' attributes HOT 3
- Datepicker plugin not able to correctly set the date format as specified
- jeditable destroys user tooltips HOT 2
- Introducing malle: similar to jquery-jeditable but without jquery
- Possible bug in display of selected select option on edit HOT 1
- placeholder option has multiple functions HOT 2
- Using JSON to fill a dropdown selection HOT 6
- Implementing adding new row on the using jquery.jeditable.js library HOT 4
- For a JSON return how do I pass a parameter to the php via loadurl? HOT 2
- Pass extra parameters using submitData HOT 6
- Save.php not launching HOT 5
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 jquery_jeditable.