jsxgrid 2.2.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/README.md +15 -0
  2. package/dist/fields/jsgrid.field.XDateTimeField.min.js +2 -2
  3. package/dist/fields/jsgrid.field.XRowSelectField.min.js +2 -2
  4. package/dist/fields/jsgrid.field.Xcheckbox.min.js +2 -2
  5. package/dist/fields/jsgrid.field.Xcontrol.min.js +2 -2
  6. package/dist/fields/jsgrid.field.XimgField.min.js +2 -2
  7. package/dist/fields/jsgrid.field.Xjsoneditor.min.js +2 -2
  8. package/dist/fields/jsgrid.field.Xnumber.min.js +2 -2
  9. package/dist/fields/jsgrid.field.Xselect.min.js +2 -2
  10. package/dist/fields/jsgrid.field.Xtext.min.js +2 -2
  11. package/dist/fields/jsgrid.field.Xtextarea.min.js +2 -2
  12. package/dist/fields/lib/jsGridSummaryPlugin.min.js +1 -1
  13. package/dist/fields/lib/jsgrid.popup.basic.min.js +1 -1
  14. package/dist/i18n/jsgrid-Ko.js +10 -2
  15. package/dist/i18n/jsgrid-cs.js +10 -2
  16. package/dist/i18n/jsgrid-de.js +10 -2
  17. package/dist/i18n/jsgrid-el.js +10 -2
  18. package/dist/i18n/jsgrid-es.js +10 -2
  19. package/dist/i18n/jsgrid-fa.js +10 -2
  20. package/dist/i18n/jsgrid-fr.js +10 -2
  21. package/dist/i18n/jsgrid-he.js +10 -2
  22. package/dist/i18n/jsgrid-it.js +10 -2
  23. package/dist/i18n/jsgrid-ja.js +10 -2
  24. package/dist/i18n/jsgrid-ka.js +10 -2
  25. package/dist/i18n/jsgrid-lt.js +10 -2
  26. package/dist/i18n/jsgrid-pl.js +10 -2
  27. package/dist/i18n/jsgrid-pt-br.js +10 -2
  28. package/dist/i18n/jsgrid-pt.js +10 -2
  29. package/dist/i18n/jsgrid-ru.js +10 -2
  30. package/dist/i18n/jsgrid-tr.js +10 -2
  31. package/dist/i18n/jsgrid-zh-cn.js +10 -2
  32. package/dist/i18n/jsgrid-zh-tw.js +10 -2
  33. package/dist/jsxgrid-fields.js +61 -13
  34. package/dist/jsxgrid-fields.min.js +2 -2
  35. package/dist/jsxgrid-theme.css +1 -1
  36. package/dist/jsxgrid-xfields.js +98 -18
  37. package/dist/jsxgrid-xfields.min.js +2 -2
  38. package/dist/jsxgrid.css +1 -1
  39. package/dist/jsxgrid.js +25 -14
  40. package/dist/jsxgrid.min.js +2 -2
  41. package/package.json +1 -1
  42. package/src/fields/jsgrid.field.XDateTimeField.js +10 -2
  43. package/src/fields/jsgrid.field.XRowSelectField.js +10 -2
  44. package/src/fields/jsgrid.field.Xcheckbox.js +10 -2
  45. package/src/fields/jsgrid.field.Xcontrol.js +9 -1
  46. package/src/fields/jsgrid.field.XimgField.js +10 -2
  47. package/src/fields/jsgrid.field.Xjsoneditor.js +10 -2
  48. package/src/fields/jsgrid.field.Xnumber.js +9 -1
  49. package/src/fields/jsgrid.field.Xselect.js +10 -2
  50. package/src/fields/jsgrid.field.Xtext.js +9 -1
  51. package/src/fields/jsgrid.field.Xtextarea.js +10 -2
  52. package/src/fields/jsgrid.field.checkbox.js +10 -2
  53. package/src/fields/jsgrid.field.control.js +10 -2
  54. package/src/fields/jsgrid.field.number.js +10 -2
  55. package/src/fields/jsgrid.field.select.js +10 -2
  56. package/src/fields/jsgrid.field.text.js +10 -2
  57. package/src/fields/jsgrid.field.textarea.js +10 -2
  58. package/src/i18n/Ko.js +10 -2
  59. package/src/i18n/cs.js +10 -2
  60. package/src/i18n/de.js +10 -2
  61. package/src/i18n/el.js +10 -2
  62. package/src/i18n/es.js +10 -2
  63. package/src/i18n/fa.js +10 -2
  64. package/src/i18n/fr.js +10 -2
  65. package/src/i18n/he.js +10 -2
  66. package/src/i18n/it.js +10 -2
  67. package/src/i18n/ja.js +10 -2
  68. package/src/i18n/ka.js +10 -2
  69. package/src/i18n/lt.js +10 -2
  70. package/src/i18n/pl.js +10 -2
  71. package/src/i18n/pt-br.js +10 -2
  72. package/src/i18n/pt.js +10 -2
  73. package/src/i18n/ru.js +10 -2
  74. package/src/i18n/tr.js +10 -2
  75. package/src/i18n/zh-cn.js +10 -2
  76. package/src/i18n/zh-tw.js +10 -2
  77. package/src/jsgrid.core.js +23 -12
package/src/i18n/he.js CHANGED
@@ -1,4 +1,12 @@
1
- (function(jsGrid) {
1
+ (function(jsGrid) {
2
+
3
+ if (!jsGrid) {
4
+ if (window.console) {
5
+ console.error("[jsxgrid] he.js was loaded before the jsxgrid engine (jsxgrid.js) - include the engine first.");
6
+ }
7
+ return;
8
+ }
9
+
2
10
 
3
11
  jsGrid.locales.he = {
4
12
  grid: {
@@ -61,4 +69,4 @@
61
69
  }
62
70
  };
63
71
 
64
- }(jsGrid, jQuery));
72
+ }(window.jsGrid, window.jQuery));
package/src/i18n/it.js CHANGED
@@ -1,4 +1,12 @@
1
- (function(jsGrid) {
1
+ (function(jsGrid) {
2
+
3
+ if (!jsGrid) {
4
+ if (window.console) {
5
+ console.error("[jsxgrid] it.js was loaded before the jsxgrid engine (jsxgrid.js) - include the engine first.");
6
+ }
7
+ return;
8
+ }
9
+
2
10
 
3
11
  jsGrid.locales.it = {
4
12
  grid: {
@@ -61,5 +69,5 @@
61
69
  }
62
70
  };
63
71
 
64
- }(jsGrid, jQuery));
72
+ }(window.jsGrid, window.jQuery));
65
73
 
package/src/i18n/ja.js CHANGED
@@ -1,4 +1,12 @@
1
- (function(jsGrid) {
1
+ (function(jsGrid) {
2
+
3
+ if (!jsGrid) {
4
+ if (window.console) {
5
+ console.error("[jsxgrid] ja.js was loaded before the jsxgrid engine (jsxgrid.js) - include the engine first.");
6
+ }
7
+ return;
8
+ }
9
+
2
10
 
3
11
  jsGrid.locales.ja = {
4
12
  grid: {
@@ -61,4 +69,4 @@
61
69
  }
62
70
  };
63
71
 
64
- }(jsGrid, jQuery));
72
+ }(window.jsGrid, window.jQuery));
package/src/i18n/ka.js CHANGED
@@ -1,4 +1,12 @@
1
- (function(jsGrid) {
1
+ (function(jsGrid) {
2
+
3
+ if (!jsGrid) {
4
+ if (window.console) {
5
+ console.error("[jsxgrid] ka.js was loaded before the jsxgrid engine (jsxgrid.js) - include the engine first.");
6
+ }
7
+ return;
8
+ }
9
+
2
10
 
3
11
  jsGrid.locales.ka = {
4
12
  grid: {
@@ -61,4 +69,4 @@
61
69
  }
62
70
  };
63
71
 
64
- }(jsGrid, jQuery));
72
+ }(window.jsGrid, window.jQuery));
package/src/i18n/lt.js CHANGED
@@ -1,4 +1,12 @@
1
- (function(jsGrid) {
1
+ (function(jsGrid) {
2
+
3
+ if (!jsGrid) {
4
+ if (window.console) {
5
+ console.error("[jsxgrid] lt.js was loaded before the jsxgrid engine (jsxgrid.js) - include the engine first.");
6
+ }
7
+ return;
8
+ }
9
+
2
10
 
3
11
  jsGrid.locales.lt = {
4
12
  grid: {
@@ -61,5 +69,5 @@
61
69
  }
62
70
  };
63
71
 
64
- }(jsGrid, jQuery));
72
+ }(window.jsGrid, window.jQuery));
65
73
 
package/src/i18n/pl.js CHANGED
@@ -1,4 +1,12 @@
1
- (function(jsGrid) {
1
+ (function(jsGrid) {
2
+
3
+ if (!jsGrid) {
4
+ if (window.console) {
5
+ console.error("[jsxgrid] pl.js was loaded before the jsxgrid engine (jsxgrid.js) - include the engine first.");
6
+ }
7
+ return;
8
+ }
9
+
2
10
 
3
11
  jsGrid.locales.pl = {
4
12
  grid: {
@@ -77,4 +85,4 @@
77
85
  }
78
86
  };
79
87
 
80
- }(jsGrid, jQuery));
88
+ }(window.jsGrid, window.jQuery));
package/src/i18n/pt-br.js CHANGED
@@ -1,4 +1,12 @@
1
- (function(jsGrid) {
1
+ (function(jsGrid) {
2
+
3
+ if (!jsGrid) {
4
+ if (window.console) {
5
+ console.error("[jsxgrid] pt-br.js was loaded before the jsxgrid engine (jsxgrid.js) - include the engine first.");
6
+ }
7
+ return;
8
+ }
9
+
2
10
 
3
11
  jsGrid.locales["pt-br"] = {
4
12
  grid: {
@@ -61,4 +69,4 @@
61
69
  }
62
70
  };
63
71
 
64
- }(jsGrid, jQuery));
72
+ }(window.jsGrid, window.jQuery));
package/src/i18n/pt.js CHANGED
@@ -1,4 +1,12 @@
1
- (function(jsGrid) {
1
+ (function(jsGrid) {
2
+
3
+ if (!jsGrid) {
4
+ if (window.console) {
5
+ console.error("[jsxgrid] pt.js was loaded before the jsxgrid engine (jsxgrid.js) - include the engine first.");
6
+ }
7
+ return;
8
+ }
9
+
2
10
 
3
11
  jsGrid.locales.pt = {
4
12
  grid: {
@@ -61,4 +69,4 @@
61
69
  }
62
70
  };
63
71
 
64
- }(jsGrid, jQuery));
72
+ }(window.jsGrid, window.jQuery));
package/src/i18n/ru.js CHANGED
@@ -1,4 +1,12 @@
1
- (function(jsGrid) {
1
+ (function(jsGrid) {
2
+
3
+ if (!jsGrid) {
4
+ if (window.console) {
5
+ console.error("[jsxgrid] ru.js was loaded before the jsxgrid engine (jsxgrid.js) - include the engine first.");
6
+ }
7
+ return;
8
+ }
9
+
2
10
 
3
11
  jsGrid.locales.ru = {
4
12
  grid: {
@@ -61,5 +69,5 @@
61
69
  }
62
70
  };
63
71
 
64
- }(jsGrid, jQuery));
72
+ }(window.jsGrid, window.jQuery));
65
73
 
package/src/i18n/tr.js CHANGED
@@ -1,4 +1,12 @@
1
- (function(jsGrid) {
1
+ (function(jsGrid) {
2
+
3
+ if (!jsGrid) {
4
+ if (window.console) {
5
+ console.error("[jsxgrid] tr.js was loaded before the jsxgrid engine (jsxgrid.js) - include the engine first.");
6
+ }
7
+ return;
8
+ }
9
+
2
10
 
3
11
  jsGrid.locales.tr = {
4
12
  grid: {
@@ -61,5 +69,5 @@
61
69
  }
62
70
  };
63
71
 
64
- }(jsGrid, jQuery));
72
+ }(window.jsGrid, window.jQuery));
65
73
 
package/src/i18n/zh-cn.js CHANGED
@@ -1,4 +1,12 @@
1
- (function(jsGrid) {
1
+ (function(jsGrid) {
2
+
3
+ if (!jsGrid) {
4
+ if (window.console) {
5
+ console.error("[jsxgrid] zh-cn.js was loaded before the jsxgrid engine (jsxgrid.js) - include the engine first.");
6
+ }
7
+ return;
8
+ }
9
+
2
10
 
3
11
  jsGrid.locales["zh-cn"] = {
4
12
  grid: {
@@ -61,4 +69,4 @@
61
69
  }
62
70
  };
63
71
 
64
- }(jsGrid, jQuery));
72
+ }(window.jsGrid, window.jQuery));
package/src/i18n/zh-tw.js CHANGED
@@ -1,4 +1,12 @@
1
- (function(jsGrid) {
1
+ (function(jsGrid) {
2
+
3
+ if (!jsGrid) {
4
+ if (window.console) {
5
+ console.error("[jsxgrid] zh-tw.js was loaded before the jsxgrid engine (jsxgrid.js) - include the engine first.");
6
+ }
7
+ return;
8
+ }
9
+
2
10
 
3
11
  jsGrid.locales["zh-tw"] = {
4
12
  grid: {
@@ -61,4 +69,4 @@
61
69
  }
62
70
  };
63
71
 
64
- }(jsGrid, jQuery));
72
+ }(window.jsGrid, window.jQuery));
@@ -271,6 +271,13 @@
271
271
  var fieldsLocale = self._fieldsLocaleConfig;
272
272
  self.fields = $.map(self.fields, function(field) {
273
273
  if($.isPlainObject(field)) {
274
+ if(field.type && !jsGrid.fields[field.type] && window.console) {
275
+ // falls back to the plain base Field below (no filter/insert/edit
276
+ // templates), which otherwise fails completely silently - most
277
+ // often caused by the field's script loading before the engine,
278
+ // or before the field type it's supposed to register
279
+ console.warn("[jsxgrid] unknown field type \"" + field.type + "\" - falling back to the base field (no filtering/inserting/editing UI). Check that its script is loaded, and after jsxgrid.js.");
280
+ }
274
281
  var fieldConstructor = (field.type && jsGrid.fields[field.type]) || jsGrid.Field;
275
282
  var fieldLocale = fieldsLocale && field.type && fieldsLocale[field.type];
276
283
  if(fieldLocale) {
@@ -584,7 +591,6 @@
584
591
  },
585
592
 
586
593
  _resetPager: function() {
587
- this._firstDisplayingPage = 1;
588
594
  this._setPage(1);
589
595
  },
590
596
 
@@ -1052,24 +1058,29 @@
1052
1058
  },
1053
1059
 
1054
1060
  _setPage: function(pageIndex) {
1055
- var firstDisplayingPage = this._firstDisplayingPage,
1056
- pageButtonCount = this.pageButtonCount;
1057
-
1058
1061
  this.pageIndex = pageIndex;
1059
-
1060
- if(pageIndex < firstDisplayingPage) {
1061
- this._firstDisplayingPage = pageIndex;
1062
- }
1063
-
1064
- if(pageIndex > firstDisplayingPage + pageButtonCount - 1) {
1065
- this._firstDisplayingPage = pageIndex - pageButtonCount + 1;
1066
- }
1062
+ this._firstDisplayingPage = this._centeredFirstDisplayingPage(pageIndex);
1067
1063
 
1068
1064
  this._callEventHandler(this.onPageChanged, {
1069
1065
  pageIndex: pageIndex
1070
1066
  });
1071
1067
  },
1072
1068
 
1069
+ // Keeps the visible page-number window centered on pageIndex (e.g.
1070
+ // pageButtonCount=5 shows pageIndex-2 .. pageIndex+2), clamped to the
1071
+ // actual page range, instead of only shifting once pageIndex falls
1072
+ // outside the previous window - so the next/prev page is always just
1073
+ // one click away, without ever needing the "..." nav button first.
1074
+ _centeredFirstDisplayingPage: function(pageIndex) {
1075
+ var pageButtonCount = this.pageButtonCount,
1076
+ pageCount = this._pagesCount(),
1077
+ halfWindow = Math.floor((pageButtonCount - 1) / 2),
1078
+ first = pageIndex - halfWindow,
1079
+ lastPossibleFirst = Math.max(1, pageCount - pageButtonCount + 1);
1080
+
1081
+ return Math.min(Math.max(1, first), lastPossibleFirst);
1082
+ },
1083
+
1073
1084
  _controllerCall: function(method, param, isCanceled, doneCallback) {
1074
1085
  if(isCanceled)
1075
1086
  return $.Deferred().reject().promise();