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_TopicIcon
unformat help!
16/09/2011
22:37
Avatar
Shift4SMS
Las Vegas, NV
Member
Members
Forum Posts: 15
Member Since:
03/12/2010
sp_UserOfflineSmall Offline

I'm fighting with unformat and I'm hoping someone can help. I have a column that I have added a custom formatter:

      formatter:function(cellvalue, options, rowObject) {
       return cellvalue + ' <em>(' + rowObject[2] + ')</em>';
      }

I would like to strip off the <em> work that the formatter did prior to editing so I created an unformat function:

      unformat:function(cellvalue, options) {
       var re = new RegExp("\s*<em>.*?</em>","g");
       return cellvalue.replace(re,'');
      }

The problem I am running into is that for some reason, simply specifying "unformat" causes tags to be removed from the cell data. Example, the custom formatter receives the following: cellvalue="test", rowObject[2]="09/16/2011", return value = "test <em>(09/16/2011)</em>"

If I do not specify unformat, the edit text = "test <em>(09/16/2011)</em>" -- this is expected.

Ignoring my unformat above (because it is not working do to this strang behaviour) and simply defining unformat as:

      unformat:function(cellvalue, options) {
       return cellvalue;
      }

the edit text = "test (09/16/2011)" -- ARGH! This is the same value that unformat is receiving -- thus why my regular expression stripping is not working.

Am I doing something wrong or have I found a bug?

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
54 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