Skip to content
Browse files

Fix editing textares containing td elements. Thanks to para.

  • Loading branch information...
1 parent c1f3c99 commit 71bf35deb318227cc7acf0ae8911abf926f74ab0 @tonytomov committed Sep 27, 2012
Showing with 5 additions and 5 deletions.
  1. +2 −2 js/grid.base.js
  2. +3 −3 js/grid.formedit.js
View
4 js/grid.base.js
@@ -2873,9 +2873,9 @@ $.jgrid.extend({
vl = t.formatter( rowid, data[nm], i, data, 'edit');
title = this.title ? {"title":$.jgrid.stripHtml(vl)} : {};
if(t.p.treeGrid===true && nm == t.p.ExpandColumn) {
- $("td:eq("+i+") > span:first",ind).html(vl).attr(title);
+ $("td[role='gridcell']:eq("+i+") > span:first",ind).html(vl).attr(title);
} else {
- $("td:eq("+i+")",ind).html(vl).attr(title);
+ $("td[role='gridcell']:eq("+i+")",ind).html(vl).attr(title);
}
}
});
View
6 js/grid.formedit.js
@@ -453,12 +453,12 @@ $.jgrid.extend({
tmp = "";
} else {
if(nm == obj.p.ExpandColumn && obj.p.treeGrid === true) {
- tmp = $("td:eq("+i+")",obj.rows[ind]).text();
+ tmp = $("td[role='gridcell']:eq("+i+")",obj.rows[ind]).text();
} else {
try {
- tmp = $.unformat.call(obj, $("td:eq("+i+")",obj.rows[ind]),{rowId:rowid, colModel:this},i);
+ tmp = $.unformat.call(obj, $("td[role='gridcell']:eq("+i+")",obj.rows[ind]),{rowId:rowid, colModel:this},i);
} catch (_) {
- tmp = (this.edittype && this.edittype == "textarea") ? $("td:eq("+i+")",obj.rows[ind]).text() : $("td:eq("+i+")",obj.rows[ind]).html();
+ tmp = (this.edittype && this.edittype == "textarea") ? $("td[role='gridcell']:eq("+i+")",obj.rows[ind]).text() : $("td[role='gridcell']:eq("+i+")",obj.rows[ind]).html();
}
if(!tmp || tmp == " " || tmp == " " || (tmp.length==1 && tmp.charCodeAt(0)==160) ) {tmp='';}
}

0 comments on commit 71bf35d

Please sign in to comment.
Something went wrong with that request. Please try again.