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
Usage of $.jgrid.jqID everywhere where it's needed
25/02/2012
13:02
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello Tony,

I examined all places of the code of jqGrid where id selectors like $("#" + any text) are used and made correction.

I hate GitHub web interface, "Git Gui" and "Git Bash" (or msysGit) because I couldn't found simple way to post some selected commits as the new pull request. In the pull request are merged many changes even the changes which I pooled from the main code of jqGrid (your code).

Nevetheless the GitHub can be used to documentate all the changes which I suggested:

  • first of all I suggest to include " " (blank or space) to the list of the charackters which will be escaped (see here). CSS allows to include any escaped characters in the selectors (see here). jQuery UI just escapes any character which is not digit, underscore (_), hyphen (-) or english letter (A-Za-z) (see the line). I think that it's better to include explicitly all the characters which we need to escape.
  • the current code of jqGrid stay the question about escaping of p.pager and p.toppager (see here). After analysing of the code which uses p.pager and p.toppager I can suggest to hold the values of the parameters in the form of ID selector which is escaped to be used directly in jQuery. If somewhere one need to get unescaped id one can use constructions like $(ts.p.pager).attr("id") or $(ts.p.pager)[0].id. It makes the usage p.pager and p.toppager simple enough and clear. So I suggest to make the following change: see here.
  • The full changes in the code to use consequently $.jgrid.jqID devided in the changes in every module. The links below describes the changes for every module: grid.base.js, grid.common.js, grid.custom.js, grid.formedit.js and this one fix,  grid.grouping.js, grid.inlinedit.js, grid.jqueryui.js, grid.subgrid.js and grid.treegrid.js.

I hope that I found all the places of the usage of id selectors in the jqGrid code. After the includeing of the above changes I think one will be able to use any characters as ids or name property of colModel.

Best regards
Oleg

28/01/2013
17:52
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello Tony,

I want remind you about one part from the old suggestion.

I answerd last time many questions on the stackoverflow where the reason of posted problem was usage of id of grid having spaces. So I would like remind you about the suggestion to modify the line of code of jqID

return String(sid).replace(/[!"#$%&'()*+,.\\/:;<=>?@\\[\\\\\\]\^`{|}~]/g,"\\\\mce_markeramp;");

and include additional space in the list of characters which need be escaped:

return String(sid).replace(/[!"#$%&'()*+,.\\/: ;<=>?@\\[\\\\\\]\^`{|}~]/g,"\\\\mce_markeramp;");

I am very careful now with the editor used in the forum if one use backslashes in the code. So I repeat additionally in words, that I suggest just add ' ' (space character) in the mask. I think that this simple change will save many time for some developers who uses jqGrid.

Oleg

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

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

Hello Oleg,

Just added the suggestion. Thanks

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:
85 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