jeditable textile having no OK nor cancel button

Say in implementation the jeditable textile you don’t want any OK nor Cancel buttons, kinda like making your textarea an Excel cell, how to do that?

The key is to use onblur, then comment out submit and cancel. Now when you press ESC, it’s a cancel. Clicking somewhere else is an OK, or submit.

$('.editable_textile').editable('save.php', { 
	indicator : '',
	loadurl   : 'load.php',
	type      : 'textarea',
	onblur    : 'submit',
	//submit   : 'OK',
	//cancel   : 'Cancel',
	callback: function(value, settings) { 
		var retval = value.replace(/\n/gi, "
\n"); $(this).html(retval); }, });

See more examples at http://unrealideas.net/examples/05_onblur.php

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s