jquery.jqGrid.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //This file should be used if you want to debug and develop
  2. function jqGridInclude()
  3. {
  4. var pathtojsfiles = "js/"; // need to be ajusted
  5. // set include to false if you do not want some modules to be included
  6. var modules = [
  7. { include: true, incfile:'i18n/grid.locale-en.js'}, // jqGrid translation
  8. { include: true, incfile:'grid.base.js'}, // jqGrid base
  9. { include: true, incfile:'grid.common.js'}, // jqGrid common for editing
  10. { include: true, incfile:'grid.formedit.js'}, // jqGrid Form editing
  11. { include: true, incfile:'grid.inlinedit.js'}, // jqGrid inline editing
  12. { include: true, incfile:'grid.celledit.js'}, // jqGrid cell editing
  13. { include: true, incfile:'grid.subgrid.js'}, //jqGrid subgrid
  14. { include: true, incfile:'grid.treegrid.js'}, //jqGrid treegrid
  15. { include: true, incfile:'grid.grouping.js'}, //jqGrid grouping
  16. { include: true, incfile:'grid.custom.js'}, //jqGrid custom
  17. { include: true, incfile:'grid.tbltogrid.js'}, //jqGrid table to grid
  18. { include: true, incfile:'grid.import.js'}, //jqGrid import
  19. { include: true, incfile:'jquery.fmatter.js'}, //jqGrid formater
  20. { include: true, incfile:'JsonXml.js'}, //xmljson utils
  21. { include: true, incfile:'grid.jqueryui.js'}, //jQuery UI utils
  22. { include: true, incfile:'grid.filter.js'} // filter Plugin
  23. ];
  24. var filename;
  25. for(var i=0;i<modules.length; i++)
  26. {
  27. if(modules[i].include === true) {
  28. filename = pathtojsfiles+modules[i].incfile;
  29. if(jQuery.browser.safari) {
  30. jQuery.ajax({url:filename,dataType:'script', async:false, cache: true});
  31. } else {
  32. if (jQuery.browser.msie) {
  33. document.write('<script charset="utf-8" type="text/javascript" src="'+filename+'"></script>');
  34. } else {
  35. IncludeJavaScript(filename);
  36. }
  37. }
  38. }
  39. }
  40. function IncludeJavaScript(jsFile)
  41. {
  42. var oHead = document.getElementsByTagName('head')[0];
  43. var oScript = document.createElement('script');
  44. oScript.setAttribute('type', 'text/javascript');
  45. oScript.setAttribute('language', 'javascript');
  46. oScript.setAttribute('src', jsFile);
  47. oHead.appendChild(oScript);
  48. }
  49. }
  50. jqGridInclude();