jEditable textarea
jEditable textarea
jwmonteith
Posts: 13Questions: 0Answers: 0
I'm using jeditable with type 'textarea' and am finding the vertical size of the input area to be far too large. I have tried the 'height:' configuration parm, but no luck. Also made sure the input text data was trimmed of leading and trailing spaces, but again no luck. When the textarea cell is clicked, the input area expands vertically downward probably a full screen size or more. I would like to find a way to control the excessive height. Below is the code being used.
$('.edit_area').editable(function(value, settings) {
var origvalue = value;
var $this = $(this);
var parts = $this.attr("id").split("-");
var columnid = parts[parts.length-1];
parts[parts.length-1] = "ticket_tm_id";
parts[parts.length-2] = "key";
var keyval = ($("#"+parts.join("-")).text());
var newvalue = value + '^^^' + columnid + '^^^~~~' + keyval + '~~~';
//var workvar = 'value=' + value;
//alert(workvar);
updateDB(newvalue);
return(origvalue);
}, {
type : 'textarea',
cancel : 'cancel',
submit : 'submit',
height: '100',
//indicator : '',
tooltip : 'edit',
placeholder : '...'
}),
$('.edit_area').editable(function(value, settings) {
var origvalue = value;
var $this = $(this);
var parts = $this.attr("id").split("-");
var columnid = parts[parts.length-1];
parts[parts.length-1] = "ticket_tm_id";
parts[parts.length-2] = "key";
var keyval = ($("#"+parts.join("-")).text());
var newvalue = value + '^^^' + columnid + '^^^~~~' + keyval + '~~~';
//var workvar = 'value=' + value;
//alert(workvar);
updateDB(newvalue);
return(origvalue);
}, {
type : 'textarea',
cancel : 'cancel',
submit : 'submit',
height: '100',
//indicator : '',
tooltip : 'edit',
placeholder : '...'
}),
This discussion has been closed.
Replies
$(".edit_area").editable("http://www.example.com/save.php", {
type : 'textarea',
cancel : 'Cancel',
submit : 'OK',
indicator : "",
tooltip : 'Click to edit...'
});
text: {
element:function(settings,original) {
var input=$('');
if(settings.width!='none') {
input.width(settings.width);
}
if(settings.height!='none') {
input.height(settings.height);
}
input.attr('autocomplete','off');
$(this).append(input);
return(input);
}
},
[/code]
$('.edit_area').editable(function(value, settings) {
var origvalue = value;
var $this = $(this);
var parts = $this.attr("id").split("-");
var columnid = parts[parts.length-1];
parts[parts.length-1] = "ticket_tm_id";
parts[parts.length-2] = "key";
var keyval = ($("#"+parts.join("-")).text());
var newvalue = value + '^^^' + columnid + '^^^~~~' + keyval + '~~~';
//var workvar = 'value=' + value;
//alert(workvar);
updateDB(newvalue);
return(origvalue);
}, {
type : 'textarea',
cancel : 'cancel',
submit : 'submit',
text: {
element:function(settings,original) {
var input=$('');
if(settings.width!='none') {
input.width(settings.width);
}
if(settings.height!='none') {
input.height(settings.height);
}
input.attr('autocomplete','off');
$(this).append(input);
return(input);
}
},
//indicator : '',
tooltip : 'edit',
placeholder : '...'
}),
Furthermore, I'm not sure what the text : setting is used for. The code attached to it does not appear to be executing.
See my code below...
$('.edit_area').editable(function(value, settings) {
var origvalue = value;
var $this = $(this);
var parts = $this.attr("id").split("-");
var columnid = parts[parts.length-1];
parts[parts.length-1] = "ticket_tm_id";
parts[parts.length-2] = "key";
parts[parts.length-4] = "k";
var keyval = ($("#"+parts.join("-")).text());
var newvalue = value + '^^^' + columnid + '^^^~~~' + keyval + '~~~';
//var workvar = 'value=' + value;
//alert(workvar);
updateDB(newvalue);
return(origvalue);
},
{
type : 'text',
cancel : 'cancel',
submit : 'submit',
height : '50',
width : '200',
text : {
element:function(settings,original) {
var input=$('');
alert('made it to special routine');
if(settings.width!='none') {
input.width(settings.width);
}
if(settings.height!='none') {
alert('made it to height');
input.height(settings.height);
}
input.attr('autocomplete','off');
$(this).append(input);
return(input);
}
},
//indicator : '',
tooltip : 'edit for textarea',
placeholder : '...'
}),
Allan
Allan