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
usage of jQuery.parseXML and other jQuery functions
28/02/2013
12:01
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello Tony,

I suggest to reduce a little the size of jqGrid by usage standard jQuery functions. For example one can use jQuery.parseXML (see the source code) is very close to the code of stringToDoc used by jqGrid. So it seems to me that one can replace the line of grid.base.js

dstr = $.jgrid.stringToDoc(ts.p.datastr);

to

dstr = typeof ts.p.datastr !== 'string' ? ts.p.datastr : $.parseXML(ts.p.datastr);

and another line of grid.import.js

var xmld = $.jgrid.stringToDoc(o.impstring);

to

var xmld = $.parseXML(o.impstring);

One can examine additionally the requirements of usage JsonXml.js (at least the most parts of the code) and the usage of $.jgrid.parse. It seems to me that one can remove all or some parts of the code and use standard methods which are now in jQuery.

Additionally it would be good to place directly on the jqGrid download page and in the documentation which versions (from, till) of jQuery are supported by which versions of jqGrid.

It seems to me that one can also remove now some from the functions declared and used in the jquery.fmatter.js module (for example $.fmatter.isNull which will be never used or $.fmatter.isUndefined). For exmaple $.fmatter.isUndefined will be used only inside of jquery.fmatter.js module. The line like this one 

if(opts.colModel !== undefined && !$.fmatter.isUndefined(opts.colModel.formatoptions)) {

can be safe replaced to

if(opts.colModel !== undefined && opts.colModel.formatoptions !== undefined) {

or

if(opts.colModel != null && opts.colModel.formatoptions != null) { // test for null or undefind

All the changes which I suggest here are not really important, but I think that it's good to clean up code from time to time.

Best regards
Oleg

01/03/2013
10:01
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello Oleg,

You are absolutley right.

Will begin with this today.

Thanks.

Best Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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