Forum
23:09
10/08/2009
Hi Tony!
After I write relative many answers on stackoverflow and in the forum I could frequently see the same problems:
- one use some javascript files needed for jqGrid in the wrong order (like js/i18n/grid.locale-en.js and js/jquery.jqGrid.min.js) or forget to include some plugins (like ui.multiselect.js)
- one use mix of different versions of jqGrid files
- one forget to include some CSS files which required (for ui.multiselect.css, jquery.searchFilter.css and so on)
I suggest to include in the code of jqGrid of any files definition some simple variables which an be used by testing whether a dependend file included and in which version. Moreover all jqGrid components should test whether the dependend file are included before the current file and are used in the correct version.
It could save the time for both side: persons which use jqGrid and persons which make suport for jqGrid (for example you Tony).
For example, if grid.locale-en.js is not included before jquery.jqGrid.min.js then could be displayed an error like
ERROR: Please include grid.locale-en.js or other which correspond your language code BEFORE jqGrid main JS file.
One can also test whether jQuery object undefined in very simple way:
if (!jQuery) { alert ("ERROR: Please include jQuery BEFORE jqDrid!")}
or
if (ts.p.grouping && !$.isFunction($.jgrid.getAccessor($.fn.jqGrid,'groupingSetup'))) {
var errorText = "ERROR: if you use grouping feature of jqGrid you have to include Grouping feature during downloading minimized version of jqGrid or include grid.grouping.js file if you use developer version of jqGrid";
alert (errorText);
return: // or throw errorText;
}
One can make also some test whether some CSS classes are defined (for example see http://www.weask.us/entry/dete.....javascript).
Which disadvantages to implement such kind of tests in jqGrid? What do you think about.
Best regards
Oleg
Most Users Ever Online: 715
Currently Online:
41 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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66