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
Type casting for maximum compatibility??
09/10/2009
02:07
Avatar
nayrsivart
New Member
Members
Forum Posts: 1
Member Since:
09/10/2009
sp_UserOfflineSmall Offline

Hello,

I am not certain but would like to open a discussion on type casting for jqGrid.  While building a viewHelper in Zend Framework for jqGrid I wanted to allow the use of Zend Config for defining column names and params.  While doing this I found two things that were issues for this.  Zend Config loads both INI and XML files with 100% of their values as strings.  It seems on their end there should be some way to explicitly type hint values but currently there is not.

With that said, loading from a Zend Config object I was forced to map out every possible option available in jqGrid as defined in the documentation and iterate through the params and cast them appropriately.  I believe, but have yet to confirm, that jqGrid is using === vs == which is requiring an exact type.  Everything works fine except for booleans when using JSON.

The value in PHP is converted to "1" when using JSON encode.  This obviously is a string and could be casted in both languages as a boolean.

I like the idea of using explicit types so I am leaning toward lobbying Zend to change up their code to allow type hinting in config objects.  Alternatively in jqGrid you could cast the values or not use ===.  Generally if I am going to use === I will attempt to cast the value before using that operator.

Laugh

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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