<terminal>
/**
*    @Author: Arash Karimzadeh
*    @Email: me@arashkarimzadeh.com
*    @Desciption: Here, I post some of my recent
*    researches. Also you can see my code projects.
*/  
Ajax C # Chrome CMS dateNet Design Patterns includeMany JavaScript jBind Joomla jQuery Plugin rails ror RubyOnRails SQLite xul

+ All tags

Content View Hits : 178096
Bookmark and Share
Editable (jQuery Editable Plugin) PDF Print E-mail
Written by Arash Karimzadeh   
Friday, 09 January 2009 06:48

This is a real customizable jQuery editable plugin. Currently it can convert any tag (span, div, p and ...) to text input, password, textarea, drop-down list.
You can easily extend it by adding your own input type using its editableFactory object.

  1. $('div.editable').editable()
 

Above code will convert all div tags, which has .editable class, to editable.

click me!!!

Download Editable (jQuery In Place Editor)

Current version is 1.3.3
You can download it here.

jQuery Editable Plugin

  1. Formats
  2. Options
  3. Examples
  4. Extending Editable

Formats

  • $(selector).editable(options)
    For creating editable object.
  • $(selector).editable('disable') added in editable 1.3.0
    For disabling editable object after it's creation.
  • $(selector).editable('enable') added in editable 1.3.0
    For enabling a disabled editable object.
  • $(selector).editable('destroy') added in editable 1.3.0
    For destroying Editability of an editable object.

Options

  • type [string]

[default = 'text']
Currently the acceptable values are 'text','password',textarea','select'

You can extend these types by extending editableFactory which we will discuss later.
  • editBy [string] added in Editable 1.3.3

[default = 'click']
You can define jQuery event type : 'blur','dblclick','change','click'

This option may make major problem if you don't have enough knowledge about events order in different browsers.
  • submitBy [string]

[default = 'blur']
You can define jQuery event type : 'blur','dblclick','change','click'

If you set submit option, you cant use submitBy option.
  • submit [string]

Editables are by default submitted on double click. If you want to enable the submit button you must set a value for submit option.
For example set it to 'save'.

If you set type option to 'select' you'd better to define the submit option or set submitBy to blur or change.
  • cancel [string]

If you want to enable the cancel button you must set value such as 'discard' or whatever you want.

  • editClass [string:cssClass]

You can change the CSS class of your input element to the defined CSS class in your style sheet.

This style will affect just the input element. You can change submit button or cancel button styles by setting their styles in your CSS. For example if you are going to convert a div to editable you can assign a CSS class such as .editable and also define your style for buttons '.editable button'.
  • options [options]

It is used for passing customized data.

For example in using 'select' type you must define the options in key/value format:
{'key1':'value1','key2':'value2','key3':'value3',...}

You can also use it while you are extending it to use your own input tag.

  • onEdit [Function]

This function will be called each time you click on the text to convert it to edit status.After the tags converted to input tags this function will be fired.
You can use it to show a message or do some checking and block the inputs.

  1. function onEdit(content){
  2. this; //this is the current jQuery object
  3. alert(content.current+':'+content.previous)
  4. }
 

  • onSubmit [Function]

This will be called after user submit the value. Here you can check if value is change so send the new value to server.

  1. function onSubmit(content){
  2. this; //this is the current jQuery object
  3. alert(content.current+':'+content.previous)
  4. }
 

  • onCancel [Function] added in Editable 1.3.3

This will be called if you assign cancel option. Here you have access to current and previous value of editable object.

  1. function onCancel(content){
  2. this; //this is the current jQuery object
  3. alert(content.current+':'+content.previous)
  4. }
 

  • hidden Properties

You can access to current value or previous value of the editables any time by using $('editable selector').data('editable.current') or $('editable selector').data('editable.previous'). Be careful while you are using these two hidden properties.
You usually do not need these because you can easily access them in your onSubmit function and onEdit function by using content.current and content.previous.

Examples (Create Editable)

  1. This is an editable in simplest way we just add a onEdit function to it
    1. $('.editable1').editable({onEdit:begin});
     
    1. function begin(){
    2. this.append('Click somewhere else to submit');
    3. }
     

    *In these example don't forget to add jQuery ready function to each code. so your code must be like this

    1. $(function(){
    2. $('.editable1').editable({onEdit:begin});
    3. function begin(){
    4. this.append('Click somewhere else to submit');
    5. }
    6. });
     

    Click to edit me!
  2. Editable will return a jquery object so you can re-use it as you see below.
    1. $('.editable2').editable({type:'textarea',submitBy:'dblclick'}).css('background-color','#39c');
     
    Click to edit me! I will submit by dblclick!!!
  3. You can add checking after submiting or compare previous value with new value before calling Ajax function
    1. $('.editable3').editable({
    2. type:'password',
    3. submit:'save',
    4. onSubmit:end
    5. });
     
    1. <p class="editable3">Enter Password</p>
     
    1. function end(content){
    2. alert(content.current+':'+content.previous)
    3. }
     

    Enter Password!

  4. When you are using 'select' type you must set the text of div or p or whatever tag you are using to one of the options values otherwise the value will not be selected by default.
    1. $('.editable4').editable({
    2. type:'select',
    3. options:{'value1':'Item 1', 2:'Item 2', 'Item 3':'Item 3'},
    4. submit:'save',
    5. cancel:'cancel',
    6. editClass:'resultItem',
    7. onSubmit:end
    8. });
     
    1. <div class="editable4">Item 2</div>
     
    Item 2
    As you see when the text change to drop-down it Item 2 is selected by default.
    1. <div class="editable4">Item-2</div>
    2. <--! This is wrong because 'Item-2' is not defined in options -->
     

Extending Editable

You can easily extend jQuery Editable by reading this article.

Tags: JavaScript | jQuery | Plugin

Comments
Add New Search
+/-
Write comment
Name:
Email:
 
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
Please input the anti-spam code that you can read in the image.
jb  - great plugin   |2010-03-09 17:51:52
Great plugin, just what i was looking for. much better than jeditable !
GHD  - GHD   |2010-02-24 07:26:05
ghd enjoys good reputation, pink ghd is a hot style of ghd hair straightener.
jachefas  - replica handbags   |2010-02-23 09:29:48
zhjchv0223

Replica Handbags
Replica Handbags
Replica Handbags
Replica Handbags
Replica Handbags
Louis Vuitton handbags
Dior Handbags
Chloe handbags
Thomas Wylde Handbags
Loewe Handbags
replica Hermes Belts
Bottega Veneta Handbags
Replica Versace Handbags
Marni Handbags
Replica Belts
Gucci handbags
Prada Handbags
Hermes Handbags
Jimmy Choo Handbags
Fake handbags
Valentino handBags
Versace Handbags
Miu Miu handbags
Replica Belts
Balenciaga Handbags
Lancel Handbag
Fianl Sales Handbags
Louis Vuitton handbags
Replica Handbags
jachefas  - replica handbags   |2010-02-22 11:46:54
zhjchv0222

Replica Handbags
Replica Handbags
Replica Handbags
Replica Handbags
Replica Handbags
Louis Vuitton handbags
Dior Handbags
Chloe handbags
Thomas Wylde Handbags
Loewe Handbags
replica Hermes Belts
Bottega Veneta Handbags
Replica Versace Handbags
Marni Handbags
Replica Belts
Gucci handbags
Prada Handbags
Hermes Handbags
Jimmy Choo Handbags
Fake handbags
Valentino handBags
Versace Handbags
Miu Miu handbags
Replica Belts
Balenciaga Handbags
Lancel Handbag
Fianl Sales Handbags
Louis Vuitton handbags
Replica Handbags
replicascarf  - replica scarf   |2010-02-11 10:18:57
aqian100211
Chopard Sunglasses
Police Sunglasses
Alexander McQueen
Fendi Scarf
|Replica Sunglasses|
|Replica Scarf|
|Designer Replica Sunglasses|
|Wholesale scarves|
|Women's Scarves|
|Cheap Sunglasses|
|Fashion scarves|
|Hermes Handbags|
replica Sunglasses
|Gucci Sunglasses
mens Gucci Sunglasses
Chanel Sunglasses
Discount Chanel Sunglasses
Dior Sunglasses
Bvlgari Sunglasses
Louis Vuitton Sunglasses
Marc Jacobs Sunglasses
Chloe Sunglasses
Fendi Sunglasses
Prada Sunglasses
Givenchy Sunglasses
Ferragamo Sunglasses
Armani Sunglasses|
Wholesale scarves
|Burberry Scarves
Cheap Burberry Scarf
Burberry Neck Scarves
Louis Vuitton Scarf
Replica LV Scarf
Hermes Scarves
Replica Hermes Scarf
Paul Smith Scarf
Paul Smith Neck Scarves
Gucci Scarf
Gucci Replica Scarf
Neck Scarves
Coach Scarf
Coach Scarf For Women
Neck Scarves
Chanel Scarf For Women
Chanel Scarves
Shawls Scarf
MiuMiu Scarf
Related Blog
Honeyreplica Louis Vuitton Handbags
yanrikun
he...
jachefas  - replica handbags   |2010-02-09 09:38:51
zhjchv0209

Replica Handbags
Replica Handbags
Replica Handbags
Replica Handbags
Replica Handbags
Louis Vuitton handbags
Dior Handbags
Chloe handbags
Thomas Wylde Handbags
Loewe Handbags
replica Hermes Belts
Bottega Veneta Handbags
Replica Versace Handbags
Marni Handbags
Replica Belts
Gucci handbags
Prada Handbags
Hermes Handbags
Jimmy Choo Handbags
Fake handbags
Valentino handBags
Versace Handbags
Miu Miu handbags
Replica Belts
Balenciaga Handbags
Lancel Handbag
Fianl Sales Handbags
Louis Vuitton handbags
Replica Handbags
replica watches  - replica watches   |2010-02-08 05:45:10
1.genanv0208
|Replica Handbags|
|Replica Louis Vuitton|
|Replica Watches|
|replica handbags|
|Louis vuitton handbags|
|Replica Handbags|
|replica watches|
|Hermes Handbags|
|Replica Sunglasses|
|Cheap Sunglasses|
|Designer Replica Sunglasses|
2.
|Breitling watches
Breitling replica watches
Replica Breitling
Classic Watches
AIR WOLF Watches
AVENGER SEAWOLF Watches
AVENGER SKYLAND Watches
BENTLEY GMT Watches
BENTLEY MOTORS Watches
CERTIFIE Watches
CHRONO AVENGER Watches
CHRONO COCKPIT Watches
CHRONO SUPEROCEAN Watches
CHRONOMAT Watches
CHRONOMATIC Watches
CO AXIAL Watches
COCKPIT Watches
COLT AUTOMATIC Watches
COLT GMT Watches
COLT OCEANE Watches
COLT QUARTZ Watches
Emergency Mission Watches
MONTBRILLANT Watches
NAVITIMER Watches
SKYRACER Watches
SUPER AVENGER Watches
SUPEROCEAN CHRONOMATIC Watches
SUPEROCEAN HERITAGE Watches
SUPEROCEAN HERITAGE 46 Watches
SUPEROCEAN HERITAGE CHRONOGRAPHE Watches|
3.
|replicat tiffany
tiffany jewelry
Repli...
ReplicaScarf  - Replica scarf   |2010-02-05 07:05:35
aqian100205
|Replica Sunglasses|
|Replica Scarf|
|Designer Replica Sunglasses|
|Wholesale scarves|
|Women's Scarves|
|Cheap Sunglasses|
|Fashion scarves|
replica Sunglasses
|Gucci Sunglasses
mens Gucci Sunglasses
Chanel Sunglasses
Discount Chanel Sunglasses
Dior Sunglasses
Bvlgari Sunglasses
Louis Vuitton Sunglasses
Marc Jacobs Sunglasses
Chloe Sunglasses
Fendi Sunglasses
Prada Sunglasses
Givenchy Sunglasses
Ferragamo Sunglasses
Armani Sunglasses
Chopard Sunglasses
Police Sunglasses|
Wholesale scarves
|Burberry Scarves
Cheap Burberry Scarf
Burberry Neck Scarves
Louis Vuitton Scarf
Replica LV Scarf
Hermes Scarves
Replica Hermes Scarf
Paul Smith Scarf
Paul Smith Neck Scarves
Gucci Scarf
Gucci Replica Scarf
Neck Scarves
Coach Scarf
Coach Scarf For Women
Neck Scarves
Alexander McQueen
Chanel Scarf For Women
Chanel Scarves
Fendi Scarf
Shawls Scarf
MiuMiu Scarf
Related Blog
Honeyreplica Louis Vuitton Handbags
yanrikun
hermes handbags
herm...
xc   |2010-01-27 10:17:35
christian louboutin
christian louboutin cheap
christian louboutin sale
christian louboutin discount
christian shoes
christian louboutin shoes
designer handbags
louis vuitton handbags
replica handbags
ugg classic tall
ugg classic short
ugg ultra tall boots
christian louboutin boots
MBT shoes discount
MBT shoes
ugg classic cardy boots
ugg boots
Tory Burch Shoes
Giuseppe Zanotti shoes
louboutin
ugg boot
jachefas  - replica handbags   |2010-01-22 09:25:52
zhjchv0122
Replica Handbags
Louis Vuitton Handbags
Replica Louis Vuitton
Replica Handbags
Gucci Handbags
Louis vuiton Handbags
Gucci Replica Handbags
Louis Vuitton Replica Handbags
LOUIS VUITTON
Monogram Canvas Replica Handbags
Damier Canvas
Monogram Multicolore
Sobe Replica Handbags
Mahina Replica Handbags
Monogram Vernis Replica Handbags
Stephen Sprouse Replica Handbags
Damier Azur Replica Handbags
Collection Beach
Show Spring Summer 2009
Cruise 2009 Replica Handbags
Show Winter 2008 Replica Handbags
Monogram Motard Replica Handbags
Epi Leather Replica Handbags
Damier Graphite Replica Handbags
Damier Geant Replica Handbags
Monogram Watercolor
Monogram Mini Lin
Monogram Rubis Replica Handbags
Monogramouflage Replica Handbags
Suhali Leather Replica Handbags
Monogram Miroir Replica Handbags
Monogram Denim Replica Handbags
Monogram Groom Replica Handbags
Monogram Tisse Replica Handbags
Monogram Dentelle
Monogram Jokes Replica Handbags
Monogram Mira...
lv   |2010-01-25 06:35:34
chanel bags for cheap

gucci bag for sale

Balenciaga handbags

louis vuitton bag

louis vuitton handbag for cheap

ghd straighteners very cheap

ugg boots sale for cheap

Wholesale
mbt shoes  - discount mbt shoes online sale   |2010-01-19 06:09:57
Mbt shoe is physiological footwear. Mbts are really good. Mbt walking shoes, Mbt Sport is available at just $87.
Mbt shoes  - Mbt   |2010-01-04 12:29:25
Mbt shoes enjoy good quality,Mbt sport white, and Mbt m walk pink and Mbt lami black save you up to 81%
mistike  - Several changes   |2010-01-04 03:41:44
Hello,

First, thanks a lot for this plugin. I've been playing around with it all day, and made a few modifications. Thought I should post them in case some people run into the same problems / requirements as I did.

FIRST CHANGE : In order to fill up the options field via ajax, you need to fire the OnEdit event before the select box is set. To do this, move this block :

Code:
		// Call User Function
if($.isFunction(opts.onEdit))
opts.onEdit.apply( $this,
[ {
current:$this.data('editable.current'),
previous:$this.dat a('editable.previous')
}]
);


before this line :
Code:
$.editableFactory[opts.type].toEditable($this.empty(),opts);


* Example of code for populating the option field via Ajax :
Code:

//Get Self Title
$myID = $this.attr("title");

//Get options for select list
$params = 'id=' + $myID;
$.ajax({
url: 'lib/populate_select.php',
data: $params,
dataType: 'json'...
mistike  - Next   |2010-01-04 03:43:11
Sorry, seems like my post was too long ;)

* Example of code for populating the option field via Ajax :
Code:

//Get Self Title
$myID = $this.attr("title");

//Get options for select list
$params = 'id=' + $myID;
$.ajax({
url: 'lib/populate_select.php',
data: $params,
dataType: 'json',
type: 'post',
async: false,
success: function (j) {
opts.options = j;
},
  error: function (x, e) {
alert(x.status + ' ' + e);
}
});


Where the populate_select.php script returns exactly the string {'key1':'value1', etc...}, brackets and all included.
syf   |2010-01-05 14:56:24
Do you still haven't found your satisfied clothes brand? Don't worry; Paul Smith is your best choice. As the world-famous brand of British fashion, Paul Smith is welcomed by people all over the world, including celebrities. Paul Smith Suits for both man and women as it has the products of Paul Smith Men's and Paul Smith Women's. There are several categories, such as Paul Smith Jacket, Paul Smith Jeans, Paul Smith Skirts and Paul Smith Trousers & Shorts.Paul Smith have different products for different sex. For men, they can buy Paul Smith Mens Knitwear or Men's Paul Smith Outerwear in unique style , which demonstrate their virility. For women, they can select Paul Smith Dresses, Paul Smith Women's Knitwear that don't follow the main style. Paul Smith is the symbol of fashion and success, so go to have it right now.
handbags   |2010-01-21 05:04:00
chanel for cheap


shoes for sale

handbags cheap

Replica for cheap


chi hair on sale

ghd straighteners for cheap
syf   |2010-01-05 14:56:39
Jimmy Choo said feminine and elegant is his logo. So Jimmy Choo shoes and Jimmy Choo Bags become women's favorite. The Jimmy choo Shoes Sale includes jimmy choo Shoes Boots, the Jimmy Choo Casual Shoes, the Jimmy Choo Pumps Sale and jimmy choo pumps sale, with any of them can make you feel much more fashion. Jimmy Choo Handbags, Jimmy Choo Tote Bags, Jimmy Choo Shoulder Bags and jimmy choo Purses Wallets also become many girl dreams of. In 2010, there are more new product launches.
syf   |2010-01-05 14:57:12
Have you ever found that scarves can make you much more elegant and graceful? Have you found the best site for Scarves Sales? scarvessales. will give you a great help. In this web page offers Louis Vuitton Silk Scarf, Chanel Cashmere Scarf, Burberry Cashmere Scarf Shawl, Gucci Cashmere Scarf and Hat,Paul Smith Wool Knit Scarf and Hermes superfine cashmere fashion scarf to you. Any one of them can help you show your elegance and make you more beautiful and confident. There also has some new products in early 2010, let us look forward to!
syf   |2010-01-05 14:57:45
Even if you have not used Marc Jacobs, you have heard of this brand, because many national stars and super models would like to use this brand. Marc Jacobs main includes Marc Jacobs Bags and SMarc Jacobs Shoes. The bags has different styles, includes Marc Jacobs Wallet, Marc Jacobs Double-duty Bag, Marc Jacobs Messenger Bag, Marc Jacobs Shoulder Bag. Marc Jacobs Stam Bag and so on. Marc Jacobs Rain Boots is also very popular recently. More new products will be launched in 2010, so let us enjoy looking forward to! If you are a person who pursues to fashion, now you can enjoy the attention of new products in early 2010.
syf   |2010-01-05 14:58:00
Moschino designed for fashion conscious people and dramatic draw people's attention with unique design and superior style. Ranked a high reputation, moschino involves a wide range of clothing. Moschino greatly satisfies women's demands, for example,  Various Unique Blouses are typical representative of fresh and vitality. Moschino every-changing coats , which are highly favored by people. extremely charming moschino dresses and completely softness and warmth. moschino sensational skirt , which totally present people's figure. If you are looking for the slim and stylish trousers, elegance moschino will not disappointed you. Women are sure to prefer the personality design and creativity inspiration handbags, cheap moschino is the best one available for ordinary people. Moschino men exceedingly reflects people's manliness. Moschino men shirts feature mature style and while moschino stylish trousers make a romance style. Moschino dramatic cap , handsome moschino scar...
syf   |2010-01-05 14:55:57
Consumers are loyal to the famous brand for its fashion and excellence. Young man is extremely addicted to the stylish skate shoes. Supra shoes are the best choices that contain the extensive collection of skate shoes, such as the cheap supra skytop, supra suprano hi, Supra Thunder and Cheap Supra Tk Society, etc. They are reasonable and you can find the Skytop 2 Shoes For Sale on suprafootwearsale. Supra Dropshipping is convenient to customers. Most people must be familiar with ralph lauren. For example, Ralph Lauren Cooper Nylon Down Jacket, Polo Weathered Fleece Hoodie , Garrison Herringbone Blazer and Lauren Garrison Suit are popular and welcomed by men. Children and adults are keen on dolls. Dollshopsale offers various products such as Model Ships & Model Boats, transformers, aircrafts and motorcycle, etc. Young boys are prefer them to improve their practical ability. Cosplay Mantle, you need them to make some sepecial party interesting. In addition, Sc...
Mike  - Variables in options   |2009-12-22 23:44:26
Also, is there a way to use a variable as one of the options instead of a string?


Ex:
var testLabel = 'test label';
var testValue = 'test value';
$('#prodItemRow').editable({
type:'select',
options:{'':'None',testValue:testLabel},
editClass:'selectItemLabel'
});
Mike  - Add more options for selectbox?   |2009-12-21 19:20:37
I was wondering if there was an easy way to add an option onto an already pre-existing set of options for this plugin? I have an input box that I want to take whatever value is in it and add it to a select box. Is there an easy way to add it to the options:{'value1':'Item 1', 2:'Item 2', 'Item 3':'Item 3'} like maybe a push method or something?
9bbank  - I can't disable editable()   |2009-12-16 08:33:42
I can't disable editable()

mycode is
$('.edit').editable('disable');

but it not disable

how can i do ?
Maki  - Modify with "ENTER(Return)" button   |2009-11-23 14:21:17
Hello!

It's possible to exit the input box with the "ENTER(Return)" button, because now only the tab button works?

Ahead thank you for the answers!
Leon  - How to replace substring in text area?   |2009-08-28 14:07:07
Hi
This must be simple but it seems I'm just missing it somehow.

I would like onEdit: to replacing all instances of substring
Code:

with
Code:
\n


And when I'm done editing I want to change it back before submiting.
This way I want to keep new line in textbox same as in my div element.

How do I do this?

}
Leon   |2009-08-28 14:10:38
ops.. first code should be html "br".
Patrick  - Another useful modification   |2009-07-18 20:34:17
Sorry for the flurry of posts. I'm integrating this into my app and want to let you know about any changes I make in case they are useful to others.

I added a reference to the original element in the data that is returned in the onSubmit event. Without this, there is no context in that function to know what the user edited (which is necessary when editing something like a table cell where it could be *any* table cell)

So I changed line 97 of jquery.editable-1.3.3.js to add the "ele" parameter like this:

func.apply($this,
[{
current: $this.data('editable.current'),
previous: $this.data('editable.previous'),
ele: $this
}]
Patrick  - Submitting the button with the space bar   |2009-07-18 20:05:42
There seems to be another bug in the code (I am using the "latest" version and not the "beta" version, by the way.)

If you are using a submit button ala:
$(".editable").editable({
submit: 'ok'
});

and after editing the text, then hit TAB to move the focus to the button and then SPACE to submit the button, it will actually do a post back instead of running the client side code.

Clicking the button works fine. But submitting with the keyboard does not.
Patrick  - Fix for this issue   |2009-07-18 20:18:55
Here is how I fixed this issue. I changed the lines:

// Submit Event
if (opts.submit)
{
$('').appendTo($this)
.html(opts.submit)
.one('mouseup', function() { opts.toNonEditable($(this).parent(), true) });

to:

// Submit Event
if (opts.submit)
{
$('').appendTo($this)
.html(opts.submit)
.one('mouseup', function() { opts.toNonEditable($(this).parent(), true) })
.one('keypress', function() { opts.toNonEditable($(this).parent(), true); });
Patrick  - IE8 Support   |2009-07-18 19:57:16
There seems to be a bug in this using IE8. Using the most simple .editable(); call on a table cell in IE8 causes the textbox to flash, and then immediately disappear.

Works fine in FF and Chrome.

Excellent plugin, by the way. Really good work.
Patrick   |2009-07-18 19:59:03
Adding a "save" button causes it to work fine, by the way. So this works:

$(".editable").editable({
submit: 'save'
});

and this does not:

$(".editable").editable();
Patrick  - Fix for issue   |2009-07-18 20:55:31
I seem to have a fix for this issue as well... but I cannot tell if there are going to be other side-effects from doing it this way and it may not be the best fix.

Essentially, the problem is that the blur event handler is being attached both to the new text box and to the parent of the text box. IE8 apparently interprets this to mean that one of those elements has the blur even fire immediately (essentially cancelling your edit).

My fix was to not attach the blur even to the parent of the text box, and only to the text box itself. Here is the changed code (from the else statement for the // Submit Event:

} else
$this //.one(opts.submitBy, function() { opts.toNonEditable($(this), true) })
.children()
.one(opts.submitBy, function() { opts.toNonEditable($(this).parent(), true) })
;

Notice I left the original code, just commented it out.
[ PH7 ]  - aaaalie   |2009-06-19 04:37:47
design e safe ke aaalie, Code nevisit ham ke harf nadare, vaghti in page ro ziro roo kardam avalin chizi ke be zehnam resid in bood ke ye jaye comment peyda konam va benevisam:

EEEEYYYYVAAAALLLLL
Basti  - Great   |2009-04-08 23:40:55
Hi, thanks for that plugin!

I have to edit a table and pass some extra values besides the text that is edited:

Is there a way to pass the column title ( ) and the text of the first cell in the row ( "ID" ).

Thanks for your work.
Anna  - help with editable plugin   |2009-03-31 00:11:50
Hi Arash,
Your plugin looks too good! I was trying to use and and it just fits my requirements. Being a beginner, I am facing one small issue here. I want to introduce a new line between the input type and the buttons. How can I do that without modifying/extending your plugin.
Please help.

-Anna
arash  - You can use onEdit   |2009-03-31 10:33:53
use on edit method. There you can get the current block by this keyword. and you can use something like below (It is not tested):

$('input:first',this).appned("");

or extend the editable easily by duplicating the text type codes.
Anna  - onEdit didnt work..somehow   |2009-04-03 01:16:00
Arash,
i tried what you suggested, but it didn't work.
I also tried:
$('').appendTo('.inputbox', this);
where inputbox is the class that I pass as a value for option 'editClass'.
This doesn't work either.

Please help. I don't intend to extend the plugin.
gfg  - fgdfgds   |2009-04-01 16:13:50
fgfdgdfgdfgf
Anna wrote:
Hi Arash,
Your plugin looks too good! I was trying to use and and it just fits my requirements. Being a beginner, I am facing one small issue here. I want to introduce a new line between the input type and the buttons. How can I do that without modifying/extending your plugin.
Please help.

-Anna
Jon B  - Use with external link   |2009-03-19 23:36:11
what I need todo is use a link to make
3 fields editable at the same time.


Say I have a list of data that has inplace edit

for now well say Item 1,2,3
so for each item it has 3 values say id, title, content


now I want to have a button or link that when pressed
turns all 3 fields into an in place edit and submit with a button.

basically can i have a group of fields to edit at one time?
arash  - Yes it is possible   |2009-03-20 11:32:57
read "Extending Editable" part.One way to do this is using $.editableFactory and duplicate the text type functions which is already coded, rename it to something like multiText and there create as many input you need.
Hrachya  - Can't make the Enter button work...   |2009-03-18 04:01:50
Hi Arash. Can't find out how to call a Cancel or Submit action via pressing the Esc or Enter keys.
Code:

$("div.tags").editable({onSubmit:submitTag, onEdit:keyPressControl});
function keyPressControl(){
$(this).keydown(

 function(event){

{
if (event.keyCode == 13) {
DON't KNOW...
} else if (event.keyCode == 27) {
DON't KNOW...
}
}
}

)
}

Could you please tell me how to call that events...
arash  - Extend $.editableFactory   |2009-03-18 15:18:15
read "Extending Editable" part. You must use $.editableFactory and duplicate the text type, rename it to something like superText and add your codes in there.
Mobragauk  - Controlling the textarea   |2009-03-06 16:20:28
Is there any way to control the rows and cols of the editable textarea?
arash  - yes extend it   |2009-03-06 16:54:18
You can extend editable read more @ http://arashkarimzadeh./index.php/jquery/9-how-to-extend-jquery-editable.html
Anna   |2009-03-31 00:34:27
I have done it by defining a class and then by passing that class name as editClass option to editable.
Oinopion  - Unsubscribe from notifications   |2009-02-24 19:55:49
Your surely send a lot of mails!

PS Maybe using public code hosting like code.google. or github or bitbucket. would be better?
donk  - onSubmit also executes cancel   |2009-02-23 10:25:57
Hello, I have the following:
$("td.status").editable({
type: 'select',
options:{'A':'Active','I':'Inactive'},
editClass:'editing',
cancel:'Cancel',
submit:'OK',
onSubmit:saveOnce
});
The problem is that clicking cancel still executes the function defined by onSubmit. Is this by design? I wonder if there should be onCancel, but clearly clicking cancel should not execute onSubmit.
donk  - also when no change is made   |2009-02-23 11:23:56
When no change is made, clicking OK (the submit button) will also fire onSubmit. I'm having to do content.current==content.previous checks in the onSubmit, but I think it would be nice if this check is built-in and not fire onSubmit at all unless there is content change.
donk  - how to get Value from type:'select'   |2009-02-23 12:29:43
after providing the options:{'value1':'text1','value2':'text2'} for type:'select', how do you get the 'value2' instead of 'text2' when using onSubmit? because content.current is 'text2'.
arash  - I recommend you read how to extend Editable   |2009-02-24 10:38:41
Here is a simple solution:
check key/values in your onSubmit function

Or the better way is extending the select of editable:
first download the editable (not the minimized version).
you can change the code for select:
find $.editableFactory > 'select' > getValue function.
change the following part:
Code:
function(){
if($(this).attr('selected'))
return item = $(this).text();
}

to
Code:
function(){
if($(this).attr('selected')){
$this.data('editable.value',$(this) .val());
return item = $(this).text();
}
}

It's better to read how to extend editable and learn how to extend $.editableFactory with new type such as selectValue instead of changing the implemented select.
http://arashkarimzadeh./index.php/jquery/9-how-to-extend-jquery-editable.html
Daniele   |2009-06-09 20:24:48
Hi, i've change the code from
Code:
function(){

if($(this).attr('selected'))

return item = $(this).text();

}

to
Code:
function(){

if($(this).attr('selected')){

$this.data('editable.value',$(thi s) .val());

return item = $(this).text();

}

}


but the variable "valore" don't print the value of select. Why?

Code:

$('.editable_select').editable({
type:'select',
   options:{'1':'Azienda','2':'Agriturismo','3':'Consorzio/Cooperative','4':'Ente pubblico/Camera di commercio','5':'Altro'},
submit:'save',
  cancel:'cancel',
 editClass:'resultItem',
onSubmit:function(content){ 
$.post("http://localhost/admin/tasks_js.php?task=edit_aziende_vip" ,{valore:$(this).val(), nome:$(this).attr("id"), id_azienda:2}) }
});


Thanks,
Daniele
arash  - I am not sure why   |2009-06-19 09:26:01
I am not sure why but you can email me your test case. I will check it for you.
arash  - Yes. it will execute onSubmit   |2009-02-24 10:21:39
the difference between submit and cancel is the values stored in content.
function onSubmit(content){/*somecode*/}
If you hit cancel the content.previous and the content.current would be the same so you can skip submission or do what ever you want.

Usually by nature of code you treat the cancel and re-entering the same value in the same way. So you can handle them both in your onSubmit function.

Send me your case if it make sense I would be glad to implement onCancel for this plugin.
The reason I did not implement is to keep the code as minimized as possible.
ertewr  - re: Question   |2009-02-19 00:28:04
mitch wrote:
Hello, Im trying to use your plugin, Im just confused on how or where do i set the url where the new values will be passed? pardon, im just a beginner in jquery. tnx.
arash  - I have write an article for it   |2009-02-19 09:52:07
You can read the article and download the sample code http://elemenex./index.php?option=com_content&view=article&id=22:jquery-edita...
Oinopion  - Not workin with jQuery.noConflict()   |2009-02-18 16:21:33
Hello!
Your plugin doesn't work, when noConflict mode is on.
To fix this you can wrap your code with:
Code:
(function ($) { your code goes here })(jQuery)
arash  - Tanx   |2009-02-18 19:08:45
It is fixed in editable 1.3.2
Jacob Friis Saxberg  - on enter   |2009-02-10 18:35:13
Here's how I made it submit by key press:

$('#milestoneNew').keydown(keyControl);

function keyControl (event) {
if (event.keyCode == 13) {
$('#milestoneNew button:contains("save")').mouseup();
} else if (event.keyCode == 27) {
$('#milestoneNew button:contains("cancel")').mouseup();
}
}
donk  - populate type:select using ajax   |2009-02-05 11:39:24
using type: select, I'm trying to figure how options:{xxx:yyy} can be populated by ajax call? I tried
options:$.getJSON(url), but it bombed.
arash  - load data before making item editable   |2009-02-06 12:25:28
I am not sure what your case is.

First Solution
It is necessary for data to be loaded before you use $().editable(options).

And also make sure the format of data in option field is {key:value,key:value} which is available in samples and you can download it from download section.

Second Solution
If you really need the data to be loaded on click while the element converting to editable you must extend the editable. you can see extending editable tutorial.

After you read that article determine these hints:
you can add this functionality this way:
1.Use $this.data('editable.current') and $this.data('editable.previous') to hold data. These will be used when the system convert edtiable to none-editable.
2.you can use $this in toEditable in editable factory and extend its $.data(,) if you are not familiar with this method read it in jQuery.
3.You can show a loader image while creating edtiable content in toEditable and the show the real select tag in your Ajax ...
donk  - dont have data until document loaded   |2009-02-07 04:01:25
I tried both your options and I'm still nowhere closer to finding the solution.

Here is my problem:

The jquery handler is loaded prior the document (in the head section) then an element within the body is designated as editable. The data that is going to be available for populating the is then available only at that point by the rendering script (it's a dynamic page). Prior to discovering editable plugin, I would have just made that element and work my ajax onchange. I thought initially I could use ajax to populate the to allow minimal changes to this editable. But extending the editable to use ajax leaves me no access to the attributes of the editable element so I can use it as arguments in the ajax call. Ideally I would like to generate the data for the during page load to be used later by editable because it's faster than ajax and similar to how I would have used it prior to editable, but I'm caught by the problem I explained above.

thoughts?
arash  - Send me your code   |2009-02-09 14:12:38
I can just say you must load the options of your drop down first and then use $('element').editable(....)
Or you can extend it if you really need loading data after editable conversion.

If you still have the problem, email me your code.
donk  - Ajax Populate works using onEdit   |2009-02-10 05:35:14
I finally resorted to using ajax to populate the options list. The editable handle starts with type: select, options: {} to give it empty options. in the onEdit function, I make ajax calls to return .getJSON that is then populating the using exactly what is being done in the editable factory for select. Thanks for looking into all these. great stuff btw.
cagatay  - use enter for submit   |2009-02-04 00:49:26
Nice work. Thanks.

But, I'd like to have enter key act as submit button and esc key act as cancel button.
arash  - You can Use onEdit   |2009-02-04 16:28:47
You can Use onEdit method and assign functionality such as enter press to your textbox or read Extending Editable part which let you write new editable for examples editable with multiple inputs.

if you wonder how to assign onEnter functionality it is something like this:
Code:
$('.loginPanel > :password').keydown(
function(event){
 if(event.keyCode==13)
$.ext.login.start()
}
)

as you see this code will check if the key down event.keyCode is 13 (enter) then do some action. cancel is the same you must find the Esc code.
John  - Comment   |2009-02-03 17:59:44
Any solution to manage who can access to edit the text ? Because I think this is the main limitation to be used.

If we can use this with a users manager, to let to one to see only and another one to see and edit, this would be wonderful.

Then, when you save modifications, may be the possibility to use a mysql database could be nice too.

Thanks

John
arash  - Use Disable or Destroy   |2009-02-03 20:47:45
If you wnat to block the editable for a user or after an action use disable or destroy .

And also remember that if you want to handle user management on client side it's risky and hackers can by pass it easily. so you'd better to not set it to edit mode on your server-side if your user do not have the right permission.
ghd  - ghd   |2010-01-23 06:57:49
ghd gold owns exquisite design. ghd iv is much hot among women. so try to buy one of ghd hair straighteners.
mitch  - Question   |2009-01-28 13:00:52
Hello, Im trying to use your plugin, Im just confused on how or where do i set the url where the new values will be passed? pardon, im just a beginner in jquery. tnx.
arash  - Use $.Ajax   |2009-01-28 14:20:32
You can use Editable onSubmit
There you can use Ajax to upload your data.
If you don\'t know how to use Ajax you can read jQuery Ajax examples here:

http://docs.jquery./Ajax/jQuery.ajax#examples
Anonymous  - re: Use $.Ajax   |2009-02-04 04:48:29
Arash Karimzadeh wrote:
You can use Editable onSubmit
There you can use Ajax to upload your data.
If you don\'t know how to use Ajax you can read jQuery Ajax examples here:

http://docs.jquery./Ajax/jQuery.ajax#examples
tom33  - pb with onSubmit   |2009-02-25 20:27:16
Hi there.
there is a bug with the onSubmit action.
that's not wait the user click on the submit button.
Sorry if my english is not perfect but i'm french ;)
i'm trying to explain you about the onsubmit action.
I want to send a POST wit the $.post action ONLY if the user click on the submit button :

Code:

$('.editable1').editable({
type:'textarea',
submit:'Valider',
cancel:'An nuler',
onSubmit:$.post("../base/maj_individu.php",
{
name :$(".editable1").attr("id"),
value:$(".editable1") .text()
},
function(data)
{
alert("Donnée modifiée : " +data);
}
)
});
};


but the submit run as the jquery loading ...

i'm trying on a simple .html page ... same action ...

so i think there is a bug with this action.
arash  - There is no bug   |2009-02-26 13:18:35
onSubmit accept function. in jQuery whenever we talk about function. We should write it this way:
Code:
function(){your code}

so we have:
Code:
onSubmit:function(content){ $.post("../base/maj_individu.php",{value:content.current, name:$(".editable1").attr("id")},... }

Read again onSubmit function in this article and samples too.
tom33  - you're the one !   |2009-02-26 13:45:23
ho come on you're the one !

Thk a lot for your help that's work now.

Thk !!
Tom33  - modification about "cancel" bouton   |2009-03-02 20:01:40
I back,

I want to prevent you about a modification neccessary on you're "cancel" button.

'Cause if you make a :

[code]type:'textarea',

submit:'Valider',

cancel:'Annuler',

onSubmit: end
[code]
and you clic on "cancel", it's load "onSubmit".

So, we have make a little moddification on you're code :

Code:

if(opts.cancel){
$('').appendTo($this)
.html(opts.cancel)
.one(' mouseup',function(){opts.onCancel($(this).parent(),false)});
}

//------------ ----------------------

options.onCancel = function($this,change){
opts = $this.data('editable.options');
// Configure events,styles for changed content
$this.one('click',$this.data('editable.options').toEditable)
 .data( 'editable.current',
change 
?$.editableFactory[opts.type].getValue($this,opts)
:$this.data('edi table.current')
)
.html(
opts.type=='password'
  ?'*****'
...
arash  - get the latest version 1.3.3   |2009-03-02 22:08:02
get this version the cancel functionality is implemented in the safe way in this version.
tom33   |2009-03-04 11:29:16
This is the version i'de take but you're cancel use a onSubmit at the end.
So modification or not of the data, you send the data.

In our modification, we have deleted the "onsubmit" at the end :) .
arash   |2009-03-04 15:09:27
You must set onCancel method too! read the documentation again where I have talked about onCancel Function.
Also get 1.3.4-beta there was another bug for this newly added function in sequence of event raising.
post me back if you still have problem.
tom33  - re: modification about "cancel" bouton   |2009-03-05 11:25:23
Ok you're beta version look like good !
ghd  - ghd   |2010-01-23 06:53:56
ghd straightners catch people's eyes.people expect to see new items of ghd hair straighteners, while the classic items are still hot, like ghd purple

5. ghd styler iv is in season of ghd straighteners, you would like to try a piece of ghd pure.
ghd  - ghd   |2010-01-23 06:53:08
ghd straighteners outlet. pink ghd straighteners and ghd dark are sold at best price.

14. we offer best prices of ghd hair straighteners. pink ghd hair straighteners is $76 only and [url=http://www.discountukghd./ghd-pure-white-limited-edition-hair-straighteners
ghd  - ghd   |2010-01-23 06:53:34
cheap ghd can be found at our web, ghd iv salon styler is hot one of ghd hair straighteners.

11. ghd straighteners are all quality guaranteed.you may be interested in pink ghd or
ghd kiss.
mbt shoes  - mbt shoes   |2010-01-30 09:07:48
Mbt shoe are known as antishoe,Mbt lami shoesv and Mbt chapa shoes are included.
replica watches  - replica watches   |2010-02-01 11:28:08
genanv0201

Replica Louis Vuitton|
Replica Watches|
replica handbags|
Louis vuitton handbags|
Replica Handbags|
replica watches|
Wholesale Replica Handbags|
Hermes Handbags|

|Breitling watches|
Breitling replica watches|
Replica Breitling|
Classic Watches|
AIR WOLF Watches|
AVENGER SEAWOLF Watches|
AVENGER SKYLAND Watches|
BENTLEY GMT Watches|
BENTLEY MOTORS Watches|
CERTIFIE Watches|
CHRONO AVENGER Watches|
CHRONO COCKPIT Watches|
CHRONO SUPEROCEAN Watches|
CHRONOMAT Watches|
CHRONOMATIC Watches|
CO AXIAL Watches|
COCKPIT Watches|
COLT AUTOMATIC Watches|
COLT GMT Watches|
COLT OCEANE Watches|
COLT QUARTZ Watches|
Emergency Mission Watches|
MONTBRILLANT Watches|
NAVITIMER Watches|
SKYRACER Watches|
SUPER AVENGER Watches|
SUPEROCEAN CHRONOMATIC Watches|
SUPEROCEAN HERITAGE Watches|
SUPEROCEAN HERITAGE 46 Watches|
SUPEROCEAN HERITAGE CHRONOGRAPHE Watches|

|replicat tiffany|
tiffany jewelry|
Replica Bags|
Hermes Handbags|
Replica Purses|
Replica Mobil...
Anonymous   |2010-02-04 10:10:47
We have the 100% real louis vuitton handbags,you can click our webpage: Louis Vuitton to choose handbags for yourself. Sure,someone want Christian Louboutin,we know the Louboutin shoes are so fashion all around the world,it’s the best women’s shoes,if you are a fashion girl,you can buy discount handbags or manolo blahnik in my online shop.
bushworlda  - ghd hairirons   |2010-02-08 04:53:06
The top hair straighteners are collected here, you will find ghd and CHI Flat iron at our web.
bushworlda  - ghd hairirons   |2010-02-08 04:53:27
The top hair straighteners are collected here, you will find ghd and CHI Flat iron at our web.
cv   |2010-02-22 10:18:49
Do you know where is the hot shopping 2010 ?should the MBT shoes and the handbags have to instead by the christian louboutin shoes or louis vuitton handbags which can make you delicate and luxury!worry about the price of the designer handbags ?or thought the christian louboutin,ugg classic cardy and UGG Kid's Classic is too high to get one ?from now on,it's not a dream to hold christian louboutin sale and replica handbags,here we have the substantial ugg classic tall boots and quality guarantee,welcome!
fendi handbags kooba handbags sf handbags alexander wang handbags herve leger dress ghd straighteners hair straighteners ysl handbags lancel handbags mulberry handbags hermes handbag discount designer handbags hermes kelly handbag replica chloe handbags loewe handbag miu miu leather bag jimmy choo handbags lancel handbag discount burberry handbags burberry handbag marc jacobs handbags sale marc jacobs stam bag marc jacobs quilted bag handbags by marc jacobs mar...
Louis Vuitton   |2010-02-26 09:45:11
Gucci
Louis Vuitton
Christian Louboutin


alexander mcqueen|chanel bags|Chloe handbags|salvatore shoes|australia boots|Chanel Handbags|Chloe Shoes|st laurent yves|christian boots|Cheap Louis Vuitton|Christian Louboutin boots|st yves laurent|Chloe Handbags|D&G|tory burch boots|Christian Louboutin boots|d&g bags|D&G Bags|tory burch flats|Christian Louboutin heels|discount handbags|Fashion online shop|tory burch shoes|Christian Louboutin high heels|GUCCI|Fendi boots|tory shoes|Christian louboutin shoes|Gucci Handbags|Fendi Shoes|ugg australia|christian shoes|handbags discount|Jimmy Choo boots|uggs australia|fendi|Miu Miu boots|womens short boots|giuseppe|louis vuitton backpack|Miu Miu Shoes|Yves Saint Laurent|Giuseppe Zanotti|Louis Vuitton Bags|Salvatore Ferragamo boots|Yves Saint Laurent shoes|Giuseppe Zanotti shoes|louis vuitton epi leather|Yves Saint Laurent boots|zanotti|Jimmy Choo|Louis Vuitton Handbags|Yves Saint Laurent Shoes|zanotti giuseppe|Jimmy Choo shoes|Louis Vuitton onlin...
louis vuitton   |2010-03-09 04:41:48
Chanel Handbags|Chanel|Gucci|Gucci Handbag|Christian Louboutin|Alexander McQueen|Chloe|Fendi|Giuseppe Zanotti|jimmy choo|Manolo Blahnik|Miu Miu|Salvatore Ferragamo|Tory Burch|UGG Australia|Yves Saint Laurent|LV|Louis Vuitton|Louis Vuitton Handbags|Louis Vuitton Bags|LV Surya Bags|LV Mahina Bags|LV Epi Leather Bags|LV Suhali leather Bags|LV Damier Canvas Bags|LV Nomade Leather Bags|LV Stephen Sprouse Bags|LV Evening Collection Bags|LV Monogram Canvas Bags|LV Monogram Denim Bags|LV Monogram Vernis Bags|LV Monogram Mini Lin Bags|LV Monogram Multicolore Bags|LV Show Fall Winter 2009 bags|LV Show Spring Summer 2009 Bags|Chanel Bags|Chanel 2009 Cluthes Bags|Chanel 2010 New handbags|Chanel 2009 Cambon Bags|Chanel 2009 Denim Bags|Gucci Bags|Gucci 2010 Classic bags|Gucci 2010 Cuise bags|Gucci 2010 Fall winter Bags|Chloe Bags|Marc Jacobs Bags|Prada Bags|Miu Miu Bags|Dior Bags|D& G Bags|Jimmy Choo Bags|Loewe Bags|Gucci|Handbags|Louis Vuitton Handbags|Chanel Handbags|Chloe Handbags|Gucci Handbags|

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

Last Updated on Wednesday, 04 March 2009 11:33
 
</terminal>