Forum



16:45

29/12/2010

Hi,
I'm using custom formatter to display: 'no translation available…' text whenever data in one cell is empty or null.
Here is how my format/unformat functions look like:
function emptyTranslationFormatter(cellvalue, options, rowObject) {
if (cellvalue == null || cellvalue == '')
return 'no translation available...';
return cellvalue;
}
function emptyTranslationUnformatter(cellvalue, options, cellobject) {
return '';
}
Column is defined this way
{ name: 'Title', index: 'Title', sortable: false, formatter: emptyTranslationFormatter, unformat:
emptyTranslationUnformatter, editable: true, editoptions: { size: 100} },
I use:
* jqGrid 3.8.2
* jQuery 1.4.4
* I have locale js file included before jqGrid js.
How can I force empty values appear on edit form while having nice text available in grid's read-only
appearance ?
many thanks,
Åukasz Podolak
13:19

21/04/2011

Hello, I've tried with jqgrid 4.1 and it works fine.
Cellvalue in formatter function is "" and therefore the if condition is true..
Did you try debugging to find the value of "cellvalue"..? try a alert("*"+Cellvalue+"*") inside
the formatter to see what you get.. (*s added to distinguish spaces in the alerted message if Cellvalue is a space)
Most Users Ever Online: 715
Currently Online:
41 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