Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
Why unformat mechanism does not respect empty strings or nulls ?
29/12/2010
16:45
Avatar
lpodolak
New Member
Members
Forum Posts: 2
Member Since:
29/12/2010
sp_UserOfflineSmall Offline

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

18/01/2011
19:29
Avatar
lpodolak
New Member
Members
Forum Posts: 2
Member Since:
29/12/2010
sp_UserOfflineSmall Offline

Can anybody help me with this?:)

thanks

15/06/2011
17:44
Avatar
jakemonO
Member
Members
Forum Posts: 16
Member Since:
20/08/2010
sp_UserOfflineSmall Offline

you get any resolution on this? I have the same problem (jqGrid 3.7.2)

19/06/2011
13:19
Avatar
Bugzee
Member
Members
Forum Posts: 7
Member Since:
21/04/2011
sp_UserOfflineSmall Offline

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)

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
49 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information