Forum
17:12
22/02/2011
Hi There,
Thank You for this great application by the way.
The problem is when you set cellEdit true and you have the cell set to textarea hitting enter will cause the data to be save instead of creating a new line. On a text area this is not the expected behavior.
I have newest version of cqgrid and it happens on both firefox and chrome.
Geza
01:35
16/08/2011
I'm temporarily using the solution posted here :
/blog/?page_id=393/bugs/jqgrid-3-8-1-celledit-enter-key-saves-cell-instead-of-adding-new-line-in-textarea-with-solution/
I'm using JQGrid 4.1.1. I had to REPLACE:
if (e.keyCode === 13) {$($t).jqGrid("saveCell",iRow,iCol);}//Enter
WITH
if (e.keyCode === 13 && (e.target.tagName === undefined || e.target.tagName != 'TEXTAREA')) {$($t).jqGrid("saveCell",iRow,iCol);}//Enter
Another common issue with the textarea is that on Save all the line breaks go away. Temp solutions from here:
http://www.trirand.net/forum/d.....#038;t=337
I had to REPLACE:
if($t.p.treeGrid && $(".tree-wrap",$(tcell)).length>0) {
$("span",$(tcell)).html(v).attr(title);
} else {
$(tcell).html(v).attr(title);
}
WITH
if($t.p.treeGrid && $(".tree-wrap",$(tcell)).length>0) {
$("span",$(tcell)).html(v).attr(title);
} else {
if ($t.p.colModel[pos].edittype && $t.p.colModel[pos].edittype=='textarea')
$(tcell).text(v).attr(title);
else
$(tcell).html(v).attr(title);
}
Hope this helps someone!
03:53
16/08/2011
There is another problem with the TEXTAREA, that it loses it's linebreaks when entering the EDIT mode in cell edit. To prevent it a custom unformatter can be applied to the TEXTAREA column.
http://www.trirand.net/forum/d..... post#6
my textarea column:
{name: 'Description', index: 'Description', width: 300, editable: true, search: false, sorttype: 'text', edittype: 'textarea', unformat: unfrmttextarea, editoptions: { rows: "10", cols: "40"} }
the unformatter func:
function unfrmttextarea (cellvalue, options, cellobject) {
return cellvalue;
}
With all the total 3 (including my prev post) changes, the textarea field now looks promising 🙂
Most Users Ever Online: 715
Currently Online:
44 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66