gridx-rails 1.1.0
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.
- checksums.yaml +15 -0
- data/LICENSE +2 -0
- data/README.md +18 -0
- data/Rakefile +36 -0
- data/app/assets/images/gridx/mobile/themes/iphone/images/ajax-loader.gif +0 -0
- data/app/assets/images/gridx/mobile/themes/iphone/images/arrow.png +0 -0
- data/app/assets/images/gridx/resources/images/checkboxpartial.png +0 -0
- data/app/assets/images/gridx/resources/images/checkboxpartialdisabled.png +0 -0
- data/app/assets/images/gridx/resources/images/claro-grid-header-onepixel.bmp +0 -0
- data/app/assets/images/gridx/resources/images/dndCopy.png +0 -0
- data/app/assets/images/gridx/resources/images/dndMove.png +0 -0
- data/app/assets/images/gridx/resources/images/dndNoCopy.png +0 -0
- data/app/assets/images/gridx/resources/images/dndNoMove.png +0 -0
- data/app/assets/images/gridx/resources/images/gridxCellChanged.png +0 -0
- data/app/assets/images/gridx/resources/images/header.png +0 -0
- data/app/assets/images/gridx/resources/images/header_shadow.png +0 -0
- data/app/assets/images/gridx/resources/images/loadingAnimation.gif +0 -0
- data/app/assets/images/gridx/resources/images/row_back.png +0 -0
- data/app/assets/images/gridx/resources/images/row_back_changed.png +0 -0
- data/app/assets/images/gridx/resources/images/sprite_icons.png +0 -0
- data/app/assets/images/gridx/resources/images/treeExpandImages.png +0 -0
- data/app/assets/images/gridx/resources/images/treeExpand_loading.gif +0 -0
- data/app/assets/javascripts/gridx/Grid.js +224 -0
- data/app/assets/javascripts/gridx/GridCommon.js +52 -0
- data/app/assets/javascripts/gridx/allModules.js +105 -0
- data/app/assets/javascripts/gridx/core/Cell.js +86 -0
- data/app/assets/javascripts/gridx/core/Column.js +183 -0
- data/app/assets/javascripts/gridx/core/Core.js +447 -0
- data/app/assets/javascripts/gridx/core/Row.js +174 -0
- data/app/assets/javascripts/gridx/core/_Module.js +285 -0
- data/app/assets/javascripts/gridx/core/model/Model.js +495 -0
- data/app/assets/javascripts/gridx/core/model/_Extension.js +84 -0
- data/app/assets/javascripts/gridx/core/model/cache/Async.js +469 -0
- data/app/assets/javascripts/gridx/core/model/cache/Sync.js +59 -0
- data/app/assets/javascripts/gridx/core/model/cache/_Cache.js +386 -0
- data/app/assets/javascripts/gridx/core/model/extensions/ClientFilter.js +303 -0
- data/app/assets/javascripts/gridx/core/model/extensions/FormatSort.js +103 -0
- data/app/assets/javascripts/gridx/core/model/extensions/Mark.js +370 -0
- data/app/assets/javascripts/gridx/core/model/extensions/Modify.js +418 -0
- data/app/assets/javascripts/gridx/core/model/extensions/Move.js +429 -0
- data/app/assets/javascripts/gridx/core/model/extensions/Query.js +50 -0
- data/app/assets/javascripts/gridx/core/model/extensions/Sort.js +81 -0
- data/app/assets/javascripts/gridx/core/util.js +13 -0
- data/app/assets/javascripts/gridx/mobile/Grid.js +300 -0
- data/app/assets/javascripts/gridx/mobile/LazyLoad.js +88 -0
- data/app/assets/javascripts/gridx/mobile/PullRefresh.js +117 -0
- data/app/assets/javascripts/gridx/mobile/Sort.js +66 -0
- data/app/assets/javascripts/gridx/mobile/nls/LazyLoad.js +38 -0
- data/app/assets/javascripts/gridx/mobile/nls/PullRefresh.js +39 -0
- data/app/assets/javascripts/gridx/mobile/nls/ar/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/ar/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/ar/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/bg/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/bg/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/bg/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/ca/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/ca/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/ca/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/common.js +37 -0
- data/app/assets/javascripts/gridx/mobile/nls/cs/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/cs/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/cs/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/da/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/da/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/da/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/de/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/de/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/de/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/el/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/el/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/el/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/es/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/es/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/es/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/fi/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/fi/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/fi/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/fr/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/fr/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/fr/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/he/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/he/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/he/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/hr/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/hr/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/hr/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/hu/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/hu/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/hu/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/it/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/it/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/it/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/ja/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/ja/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/ja/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/kk/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/kk/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/kk/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/ko/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/ko/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/ko/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/nb/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/nb/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/nb/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/nl/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/nl/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/nl/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/pl/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/pl/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/pl/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/pt/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/pt/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/pt/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/pt-pt/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/pt-pt/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/pt-pt/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/ro/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/ro/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/ro/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/ru/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/ru/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/ru/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/sk/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/sk/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/sk/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/sl/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/sl/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/sl/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/sv/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/sv/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/sv/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/th/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/th/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/th/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/tr/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/tr/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/tr/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/uk/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/uk/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/uk/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/zh/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/zh/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/zh/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/zh-tw/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/zh-tw/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/zh-tw/common.js +5 -0
- data/app/assets/javascripts/gridx/modules/AutoScroll.js +100 -0
- data/app/assets/javascripts/gridx/modules/Bar.js +322 -0
- data/app/assets/javascripts/gridx/modules/Body.js +1059 -0
- data/app/assets/javascripts/gridx/modules/CellWidget.js +538 -0
- data/app/assets/javascripts/gridx/modules/ColumnLock.js +254 -0
- data/app/assets/javascripts/gridx/modules/ColumnResizer.js +278 -0
- data/app/assets/javascripts/gridx/modules/ColumnWidth.js +320 -0
- data/app/assets/javascripts/gridx/modules/Dod.js +368 -0
- data/app/assets/javascripts/gridx/modules/Edit.js +1024 -0
- data/app/assets/javascripts/gridx/modules/Filter.js +482 -0
- data/app/assets/javascripts/gridx/modules/Focus.js +439 -0
- data/app/assets/javascripts/gridx/modules/GroupHeader.js +437 -0
- data/app/assets/javascripts/gridx/modules/HLayout.js +139 -0
- data/app/assets/javascripts/gridx/modules/HScroller.js +172 -0
- data/app/assets/javascripts/gridx/modules/Header.js +289 -0
- data/app/assets/javascripts/gridx/modules/HeaderMenu.js +63 -0
- data/app/assets/javascripts/gridx/modules/HeaderRegions.js +201 -0
- data/app/assets/javascripts/gridx/modules/HiddenColumns.js +274 -0
- data/app/assets/javascripts/gridx/modules/IndirectSelect.js +287 -0
- data/app/assets/javascripts/gridx/modules/IndirectSelectColumn.js +277 -0
- data/app/assets/javascripts/gridx/modules/Menu.js +167 -0
- data/app/assets/javascripts/gridx/modules/NavigableCell.js +170 -0
- data/app/assets/javascripts/gridx/modules/NestedSort.js +280 -0
- data/app/assets/javascripts/gridx/modules/PagedBody.js +409 -0
- data/app/assets/javascripts/gridx/modules/Pagination.js +293 -0
- data/app/assets/javascripts/gridx/modules/Persist.js +266 -0
- data/app/assets/javascripts/gridx/modules/Printer.js +49 -0
- data/app/assets/javascripts/gridx/modules/RowHeader.js +412 -0
- data/app/assets/javascripts/gridx/modules/RowLock.js +143 -0
- data/app/assets/javascripts/gridx/modules/SingleSort.js +276 -0
- data/app/assets/javascripts/gridx/modules/SummaryBar.js +33 -0
- data/app/assets/javascripts/gridx/modules/TitleBar.js +51 -0
- data/app/assets/javascripts/gridx/modules/ToolBar.js +55 -0
- data/app/assets/javascripts/gridx/modules/TouchScroll.js +103 -0
- data/app/assets/javascripts/gridx/modules/TouchVScroller.js +89 -0
- data/app/assets/javascripts/gridx/modules/Traverse.js +159 -0
- data/app/assets/javascripts/gridx/modules/Tree.js +646 -0
- data/app/assets/javascripts/gridx/modules/VLayout.js +152 -0
- data/app/assets/javascripts/gridx/modules/VScroller.js +342 -0
- data/app/assets/javascripts/gridx/modules/View.js +540 -0
- data/app/assets/javascripts/gridx/modules/VirtualVScroller.js +445 -0
- data/app/assets/javascripts/gridx/modules/barPlugins/DropDownPager.js +16 -0
- data/app/assets/javascripts/gridx/modules/barPlugins/DropDownSizer.js +16 -0
- data/app/assets/javascripts/gridx/modules/barPlugins/GotoPageButton.js +16 -0
- data/app/assets/javascripts/gridx/modules/barPlugins/LinkPager.js +16 -0
- data/app/assets/javascripts/gridx/modules/barPlugins/LinkSizer.js +16 -0
- data/app/assets/javascripts/gridx/modules/barPlugins/Summary.js +16 -0
- data/app/assets/javascripts/gridx/modules/dnd/Avatar.js +45 -0
- data/app/assets/javascripts/gridx/modules/dnd/Column.js +210 -0
- data/app/assets/javascripts/gridx/modules/dnd/Row.js +286 -0
- data/app/assets/javascripts/gridx/modules/dnd/_Base.js +60 -0
- data/app/assets/javascripts/gridx/modules/dnd/_Dnd.js +371 -0
- data/app/assets/javascripts/gridx/modules/exporter/CSV.js +43 -0
- data/app/assets/javascripts/gridx/modules/exporter/Exporter.js +34 -0
- data/app/assets/javascripts/gridx/modules/exporter/Table.js +42 -0
- data/app/assets/javascripts/gridx/modules/extendedSelect/Cell.js +491 -0
- data/app/assets/javascripts/gridx/modules/extendedSelect/Column.js +290 -0
- data/app/assets/javascripts/gridx/modules/extendedSelect/Row.js +458 -0
- data/app/assets/javascripts/gridx/modules/extendedSelect/_Base.js +244 -0
- data/app/assets/javascripts/gridx/modules/extendedSelect/_RowCellBase.js +35 -0
- data/app/assets/javascripts/gridx/modules/filter/DistinctComboBoxMenu.js +22 -0
- data/app/assets/javascripts/gridx/modules/filter/Filter.js +16 -0
- data/app/assets/javascripts/gridx/modules/filter/FilterBar.js +649 -0
- data/app/assets/javascripts/gridx/modules/filter/FilterConfirmDialog.js +33 -0
- data/app/assets/javascripts/gridx/modules/filter/FilterDialog.js +179 -0
- data/app/assets/javascripts/gridx/modules/filter/FilterPane.js +340 -0
- data/app/assets/javascripts/gridx/modules/filter/FilterTooltip.js +103 -0
- data/app/assets/javascripts/gridx/modules/filter/QuickFilter.js +33 -0
- data/app/assets/javascripts/gridx/modules/move/Column.js +223 -0
- data/app/assets/javascripts/gridx/modules/move/Row.js +154 -0
- data/app/assets/javascripts/gridx/modules/pagination/Pagination.js +16 -0
- data/app/assets/javascripts/gridx/modules/pagination/PaginationBar.js +68 -0
- data/app/assets/javascripts/gridx/modules/pagination/PaginationBarDD.js +40 -0
- data/app/assets/javascripts/gridx/modules/pagination/_PaginationBarBase.js +105 -0
- data/app/assets/javascripts/gridx/modules/select/Cell.js +229 -0
- data/app/assets/javascripts/gridx/modules/select/Column.js +209 -0
- data/app/assets/javascripts/gridx/modules/select/Row.js +302 -0
- data/app/assets/javascripts/gridx/modules/select/_Base.js +99 -0
- data/app/assets/javascripts/gridx/modules/select/_RowCellBase.js +51 -0
- data/app/assets/javascripts/gridx/nls/Body.js +47 -0
- data/app/assets/javascripts/gridx/nls/FilterBar.js +133 -0
- data/app/assets/javascripts/gridx/nls/NestedSort.js +45 -0
- data/app/assets/javascripts/gridx/nls/PaginationBar.js +68 -0
- data/app/assets/javascripts/gridx/nls/QuickFilter.js +40 -0
- data/app/assets/javascripts/gridx/nls/SummaryBar.js +38 -0
- data/app/assets/javascripts/gridx/nls/ar/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/ar/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/ar/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/ar/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/ar/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/ar/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/bg/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/bg/FilterBar.js +88 -0
- data/app/assets/javascripts/gridx/nls/bg/NestedSort.js +12 -0
- data/app/assets/javascripts/gridx/nls/bg/PaginationBar.js +28 -0
- data/app/assets/javascripts/gridx/nls/bg/QuickFilter.js +8 -0
- data/app/assets/javascripts/gridx/nls/bg/SummaryBar.js +6 -0
- data/app/assets/javascripts/gridx/nls/ca/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/ca/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/ca/NestedSort.js +13 -0
- data/app/assets/javascripts/gridx/nls/ca/PaginationBar.js +30 -0
- data/app/assets/javascripts/gridx/nls/ca/QuickFilter.js +9 -0
- data/app/assets/javascripts/gridx/nls/ca/SummaryBar.js +7 -0
- data/app/assets/javascripts/gridx/nls/cs/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/cs/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/cs/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/cs/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/cs/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/cs/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/da/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/da/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/da/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/da/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/da/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/da/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/de/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/de/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/de/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/de/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/de/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/de/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/el/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/el/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/el/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/el/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/el/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/el/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/es/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/es/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/es/NestedSort.js +13 -0
- data/app/assets/javascripts/gridx/nls/es/PaginationBar.js +30 -0
- data/app/assets/javascripts/gridx/nls/es/QuickFilter.js +9 -0
- data/app/assets/javascripts/gridx/nls/es/SummaryBar.js +7 -0
- data/app/assets/javascripts/gridx/nls/fi/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/fi/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/fi/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/fi/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/fi/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/fi/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/fr/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/fr/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/fr/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/fr/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/fr/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/fr/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/he/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/he/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/he/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/he/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/he/QuickFilter.js +6 -0
- data/app/assets/javascripts/gridx/nls/he/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/hr/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/hr/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/hr/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/hr/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/hr/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/hr/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/hu/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/hu/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/hu/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/hu/PaginationBar.js +33 -0
- data/app/assets/javascripts/gridx/nls/hu/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/hu/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/it/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/it/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/it/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/it/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/it/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/it/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/ja/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/ja/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/ja/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/ja/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/ja/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/ja/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/kk/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/kk/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/kk/NestedSort.js +13 -0
- data/app/assets/javascripts/gridx/nls/kk/PaginationBar.js +30 -0
- data/app/assets/javascripts/gridx/nls/kk/QuickFilter.js +9 -0
- data/app/assets/javascripts/gridx/nls/kk/SummaryBar.js +7 -0
- data/app/assets/javascripts/gridx/nls/ko/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/ko/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/ko/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/ko/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/ko/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/ko/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/nb/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/nb/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/nb/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/nb/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/nb/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/nb/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/nl/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/nl/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/nl/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/nl/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/nl/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/nl/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/pl/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/pl/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/pl/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/pl/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/pl/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/pl/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/pt/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/pt/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/pt/NestedSort.js +13 -0
- data/app/assets/javascripts/gridx/nls/pt/PaginationBar.js +30 -0
- data/app/assets/javascripts/gridx/nls/pt/QuickFilter.js +9 -0
- data/app/assets/javascripts/gridx/nls/pt/SummaryBar.js +7 -0
- data/app/assets/javascripts/gridx/nls/pt-br/Body.js +6 -0
- data/app/assets/javascripts/gridx/nls/pt-br/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/pt-br/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/pt-br/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/pt-br/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/pt-br/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/pt-pt/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/pt-pt/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/pt-pt/NestedSort.js +13 -0
- data/app/assets/javascripts/gridx/nls/pt-pt/PaginationBar.js +30 -0
- data/app/assets/javascripts/gridx/nls/pt-pt/QuickFilter.js +9 -0
- data/app/assets/javascripts/gridx/nls/pt-pt/SummaryBar.js +7 -0
- data/app/assets/javascripts/gridx/nls/ro/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/ro/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/ro/NestedSort.js +13 -0
- data/app/assets/javascripts/gridx/nls/ro/PaginationBar.js +30 -0
- data/app/assets/javascripts/gridx/nls/ro/QuickFilter.js +9 -0
- data/app/assets/javascripts/gridx/nls/ro/SummaryBar.js +7 -0
- data/app/assets/javascripts/gridx/nls/ru/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/ru/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/ru/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/ru/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/ru/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/ru/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/sk/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/sk/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/sk/NestedSort.js +13 -0
- data/app/assets/javascripts/gridx/nls/sk/PaginationBar.js +30 -0
- data/app/assets/javascripts/gridx/nls/sk/QuickFilter.js +9 -0
- data/app/assets/javascripts/gridx/nls/sk/SummaryBar.js +7 -0
- data/app/assets/javascripts/gridx/nls/sl/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/sl/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/sl/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/sl/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/sl/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/sl/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/sv/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/sv/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/sv/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/sv/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/sv/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/sv/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/th/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/th/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/th/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/th/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/th/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/th/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/tr/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/tr/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/tr/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/tr/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/tr/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/tr/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/uk/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/uk/FilterBar.js +88 -0
- data/app/assets/javascripts/gridx/nls/uk/NestedSort.js +12 -0
- data/app/assets/javascripts/gridx/nls/uk/PaginationBar.js +28 -0
- data/app/assets/javascripts/gridx/nls/uk/QuickFilter.js +8 -0
- data/app/assets/javascripts/gridx/nls/uk/SummaryBar.js +6 -0
- data/app/assets/javascripts/gridx/nls/zh/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/zh/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/zh/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/zh/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/zh/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/zh/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/zh-tw/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/zh-tw/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/zh-tw/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/zh-tw/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/zh-tw/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/zh-tw/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/support/DropDownPager.js +111 -0
- data/app/assets/javascripts/gridx/support/DropDownSizer.js +112 -0
- data/app/assets/javascripts/gridx/support/GotoPageButton.js +92 -0
- data/app/assets/javascripts/gridx/support/GotoPagePane.js +61 -0
- data/app/assets/javascripts/gridx/support/LinkPager.js +180 -0
- data/app/assets/javascripts/gridx/support/LinkSizer.js +138 -0
- data/app/assets/javascripts/gridx/support/QuickFilter.js +138 -0
- data/app/assets/javascripts/gridx/support/Summary.js +49 -0
- data/app/assets/javascripts/gridx/support/_LinkPageBase.js +92 -0
- data/app/assets/javascripts/gridx/support/exporter/exporter.js +350 -0
- data/app/assets/javascripts/gridx/support/exporter/toCSV.js +75 -0
- data/app/assets/javascripts/gridx/support/exporter/toTable.js +92 -0
- data/app/assets/javascripts/gridx/support/menu/AZFilterMenu.js +57 -0
- data/app/assets/javascripts/gridx/support/menu/NumberFilterMenu.js +87 -0
- data/app/assets/javascripts/gridx/support/menu/_FilterMenuBase.js +83 -0
- data/app/assets/javascripts/gridx/support/printer.js +157 -0
- data/app/assets/javascripts/gridx/templates/FilterBar.html +8 -0
- data/app/assets/javascripts/gridx/templates/FilterConfirmDialog.html +5 -0
- data/app/assets/javascripts/gridx/templates/FilterDialog.html +19 -0
- data/app/assets/javascripts/gridx/templates/FilterPane.html +64 -0
- data/app/assets/javascripts/gridx/templates/GotoPagePane.html +28 -0
- data/app/assets/javascripts/gridx/templates/Grid.html +19 -0
- data/app/assets/javascripts/gridx/templates/LinkPager.html +24 -0
- data/app/assets/javascripts/gridx/templates/PaginationBar.html +60 -0
- data/app/assets/javascripts/gridx/templates/PaginationBarDD.html +23 -0
- data/app/assets/javascripts/gridx/templates/QuickFilter.html +38 -0
- data/app/assets/stylesheets/gridx/mobile/themes/iphone/Grid.css +107 -0
- data/app/assets/stylesheets/gridx/resources/Dod.css +39 -0
- data/app/assets/stylesheets/gridx/resources/Gridx.css +10 -0
- data/app/assets/stylesheets/gridx/resources/Gridx_rtl.css +5 -0
- data/app/assets/stylesheets/gridx/resources/Tree.css +46 -0
- data/app/assets/stylesheets/gridx/resources/Tree_rtl.css +4 -0
- data/app/assets/stylesheets/gridx/resources/bar.css +24 -0
- data/app/assets/stylesheets/gridx/resources/basic.css +482 -0
- data/app/assets/stylesheets/gridx/resources/basic_rtl.css +37 -0
- data/app/assets/stylesheets/gridx/resources/claro/Gridx.css +16 -0
- data/app/assets/stylesheets/gridx/resources/claro/Gridx_rtl.css +7 -0
- data/app/assets/stylesheets/gridx/resources/claro/basic.css +109 -0
- data/app/assets/stylesheets/gridx/resources/claro/basic_rtl.css +21 -0
- data/app/assets/stylesheets/gridx/resources/claro/filter.css +47 -0
- data/app/assets/stylesheets/gridx/resources/claro/lock.css +19 -0
- data/app/assets/stylesheets/gridx/resources/claro/pagination.css +33 -0
- data/app/assets/stylesheets/gridx/resources/claro/select.css +20 -0
- data/app/assets/stylesheets/gridx/resources/dnd.css +108 -0
- data/app/assets/stylesheets/gridx/resources/filter.css +321 -0
- data/app/assets/stylesheets/gridx/resources/filter_rtl.css +38 -0
- data/app/assets/stylesheets/gridx/resources/lock.css +20 -0
- data/app/assets/stylesheets/gridx/resources/pagination.css +142 -0
- data/app/assets/stylesheets/gridx/resources/pagination_rtl.css +54 -0
- data/app/assets/stylesheets/gridx/resources/select.css +39 -0
- data/app/assets/stylesheets/gridx/resources/sort.css +154 -0
- data/app/assets/stylesheets/gridx/resources/sort_rtl.css +51 -0
- data/lib/gridx-rails/engine.rb +8 -0
- data/lib/gridx-rails/version.rb +3 -0
- data/lib/gridx-rails.rb +4 -0
- data/lib/tasks/gridx-rails_tasks.rake +52 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config/application.rb +59 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +58 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/test.log +78 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/gridx-rails_test.rb +7 -0
- data/test/test_helper.rb +15 -0
- metadata +621 -0
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
define([
|
|
2
|
+
"require",
|
|
3
|
+
"dojo/_base/declare",
|
|
4
|
+
"dojo/_base/array",
|
|
5
|
+
"dojo/_base/lang",
|
|
6
|
+
"dojo/_base/Deferred",
|
|
7
|
+
"dojo/DeferredList",
|
|
8
|
+
"dojo/aspect"
|
|
9
|
+
], function(require, declare, array, lang, Deferred, DeferredList, aspect){
|
|
10
|
+
|
|
11
|
+
/*=====
|
|
12
|
+
return declare([], {
|
|
13
|
+
// summary:
|
|
14
|
+
// This class handles all of the data logic in grid.
|
|
15
|
+
// description:
|
|
16
|
+
// It provides a clean and useful set of APIs to encapsulate complicated data operations,
|
|
17
|
+
// even for huge asynchronous (server side) data stores.
|
|
18
|
+
// It is built upon a simple extension mechanism, allowing new (even user defined) data operaions to be pluged in.
|
|
19
|
+
// An instance of this class can be regarded as a stand-alone logic grid providing consistent data processing
|
|
20
|
+
// functionalities. This class can even be instanticated alone without any grid UI.
|
|
21
|
+
|
|
22
|
+
clearCache: function(){
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
isId: function(){
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
byIndex: function(index, parentId){
|
|
29
|
+
// summary:
|
|
30
|
+
// Get the row cache by row index.
|
|
31
|
+
// index: Integer
|
|
32
|
+
// The row index
|
|
33
|
+
// parentId: String?
|
|
34
|
+
// If parentId is valid, the row index means the child index under this parent.
|
|
35
|
+
// returns:
|
|
36
|
+
// The row cache
|
|
37
|
+
return null; //gridx.core.model.__RowCache
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
byId: function(id){
|
|
41
|
+
// summary:
|
|
42
|
+
// Get the row cache by row id
|
|
43
|
+
// id: String
|
|
44
|
+
// The row ID
|
|
45
|
+
// returns:
|
|
46
|
+
// The row cache
|
|
47
|
+
return null; //gridx.core.model.__RowCache
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
indexToId: function(index, parentId){
|
|
51
|
+
// summary:
|
|
52
|
+
// Transform row index to row ID
|
|
53
|
+
// index: Integer
|
|
54
|
+
// The row index
|
|
55
|
+
// parentId: String?
|
|
56
|
+
// If parentId is valid, the row index means the child index under this parent.
|
|
57
|
+
// returns:
|
|
58
|
+
// The row ID
|
|
59
|
+
return ''; //String
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
idToIndex: function(id){
|
|
63
|
+
// summary:
|
|
64
|
+
// Transform row ID to row index
|
|
65
|
+
// id: String
|
|
66
|
+
// The row ID
|
|
67
|
+
// returns:
|
|
68
|
+
// The row index
|
|
69
|
+
return -1; //Integer
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
treePath: function(id){
|
|
73
|
+
// summary:
|
|
74
|
+
// Get tree path of row by row ID
|
|
75
|
+
// id: String
|
|
76
|
+
// The row ID
|
|
77
|
+
// returns:
|
|
78
|
+
// An array of parent row IDs, from root to parent.
|
|
79
|
+
// Root level rows have parent of id ""(empty string).
|
|
80
|
+
return []; //String[]
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
parentId: function(id){
|
|
84
|
+
// summary:
|
|
85
|
+
// Get the parent ID of the given row.
|
|
86
|
+
// id: String
|
|
87
|
+
// The row ID
|
|
88
|
+
// returns:
|
|
89
|
+
// The parent ID.
|
|
90
|
+
return [];
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
hasChildren: function(id){
|
|
94
|
+
// summary:
|
|
95
|
+
// Check whether a row has children rows.
|
|
96
|
+
// id: String
|
|
97
|
+
// The row ID
|
|
98
|
+
// returns:
|
|
99
|
+
// Whether this row has child rows.
|
|
100
|
+
return false; //Boolean
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
children: function(id){
|
|
104
|
+
// summary:
|
|
105
|
+
// Get IDs of children rows.
|
|
106
|
+
// id: String
|
|
107
|
+
// The row ID
|
|
108
|
+
// returns:
|
|
109
|
+
// An array of row IDs
|
|
110
|
+
return []; //Array
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
size: function(parentId){
|
|
114
|
+
// summary:
|
|
115
|
+
// Get the count of rows under the given parent.
|
|
116
|
+
// parentId: String?
|
|
117
|
+
// The ID of a parent row. No parentId means root rows.
|
|
118
|
+
// returns:
|
|
119
|
+
// The count of (child) rows
|
|
120
|
+
return -1; //Integer
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
keep: function(id){
|
|
124
|
+
// summary:
|
|
125
|
+
// Lock up a row cache in memory, avoid clearing it out when cache size is reached.
|
|
126
|
+
// id: String
|
|
127
|
+
// The row ID
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
free: function(id){
|
|
131
|
+
// summary:
|
|
132
|
+
// Unlock a row cache in memory, so that it could be cleared out when cache size is reached.
|
|
133
|
+
// id: String?
|
|
134
|
+
// The row ID. If omitted, all kept rows will be freed.
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
when: function(args, callback, scope){
|
|
138
|
+
// summary:
|
|
139
|
+
// Call this method to make sure all the pending data operations are executed and
|
|
140
|
+
// all the needed rows are at client side.
|
|
141
|
+
// description:
|
|
142
|
+
// This method makes it convenient to do various grid operations without worrying too much about server side
|
|
143
|
+
// or client side store. This method is the only asynchronous public method in grid model, so that most of
|
|
144
|
+
// the custom code can be written in synchronous way.
|
|
145
|
+
// args: Object|null?
|
|
146
|
+
// Indicate what rows are needed by listing row IDs or row indexes.
|
|
147
|
+
// Acceptable args include:
|
|
148
|
+
// 1. A single row index.
|
|
149
|
+
// e.g.: model.when(1, ...)
|
|
150
|
+
// 2. A single row index range object in form of: {start: ..., count: ...}.
|
|
151
|
+
// If count is omitted, means all remaining rows.
|
|
152
|
+
// e.g.: model.when({start: 10, count: 100}, ...)
|
|
153
|
+
// 3. An array of row indexes and row index ranges.
|
|
154
|
+
// e.g.: model.when([0, 1, {start: 10, count: 3}, 100], ...)
|
|
155
|
+
// 4. An object with property "index" set to the array defined in 3.
|
|
156
|
+
// e.g.: model.when({
|
|
157
|
+
// index: [0, 1, {start: 10, count: 3}, 100]
|
|
158
|
+
// }, ...)
|
|
159
|
+
// 5. An object with property "id" set to an array of row IDs.
|
|
160
|
+
// e.g.: model.when({
|
|
161
|
+
// id: ['a', 'b', 'c']
|
|
162
|
+
// }, ...)
|
|
163
|
+
// 6. An object containing both contents defined in 4 and 5.
|
|
164
|
+
// 7. An empty object
|
|
165
|
+
// The model will fetch the store size. Currently it is implemented by fetching the first page of data.
|
|
166
|
+
// 8. null or call this method without any arguments.
|
|
167
|
+
// This is useful when we only need to execute pending data operations but don't need to fetch rows.
|
|
168
|
+
// callback: Function?
|
|
169
|
+
// The callback function is called when all the pending data operations are executed and all
|
|
170
|
+
// returns:
|
|
171
|
+
// A Deferred object indicating when all this process is finished. Note that in this Deferred object,
|
|
172
|
+
// The needed rows might not be available since they might be cleared up to reduce memory usage.
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
scan: function(args, callback){
|
|
176
|
+
// summary:
|
|
177
|
+
// Go through all the rows in several batches from start to end (or according to given args),
|
|
178
|
+
// and execute the callback function for every batch of rows.
|
|
179
|
+
// args: Object
|
|
180
|
+
// An object containing scan arguments
|
|
181
|
+
// callback: Function(rows,startIndex)
|
|
182
|
+
// The callback function.
|
|
183
|
+
// returns:
|
|
184
|
+
// If return true in this function, the scan process will end immediately.
|
|
185
|
+
},
|
|
186
|
+
|
|
187
|
+
onDelete: function(){
|
|
188
|
+
// summary:
|
|
189
|
+
// Fired when a row is deleted from store
|
|
190
|
+
// tags:
|
|
191
|
+
// callback
|
|
192
|
+
},
|
|
193
|
+
|
|
194
|
+
onNew: function(){
|
|
195
|
+
// summary:
|
|
196
|
+
// Fired when a row is added to the store
|
|
197
|
+
// tags:
|
|
198
|
+
// callback
|
|
199
|
+
},
|
|
200
|
+
|
|
201
|
+
onSet: function(){
|
|
202
|
+
// summary:
|
|
203
|
+
// Fired when a row's data is changed
|
|
204
|
+
// tags:
|
|
205
|
+
// callback
|
|
206
|
+
},
|
|
207
|
+
|
|
208
|
+
onSizeChange: function(){
|
|
209
|
+
// summary:
|
|
210
|
+
// Fired when the size of the grid model is changed
|
|
211
|
+
// tags:
|
|
212
|
+
// callback
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
=====*/
|
|
216
|
+
|
|
217
|
+
var isArrayLike = lang.isArrayLike,
|
|
218
|
+
isString = lang.isString;
|
|
219
|
+
|
|
220
|
+
function isId(it){
|
|
221
|
+
return it || it === 0;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function isIndex(it){
|
|
225
|
+
return typeof it == 'number' && it >= 0;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
function isRange(it){
|
|
229
|
+
return it && isIndex(it.start);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
function normArgs(self, args){
|
|
233
|
+
var i, rgs = [], ids = [],
|
|
234
|
+
res = {
|
|
235
|
+
range: rgs,
|
|
236
|
+
id: ids
|
|
237
|
+
},
|
|
238
|
+
f = function(a){
|
|
239
|
+
if(isRange(a)){
|
|
240
|
+
rgs.push(a);
|
|
241
|
+
}else if(isIndex(a)){
|
|
242
|
+
rgs.push({start: a, count: 1});
|
|
243
|
+
}else if(isArrayLike(a)){
|
|
244
|
+
for(i = a.length - 1; i >= 0; --i){
|
|
245
|
+
if(isIndex(a[i])){
|
|
246
|
+
rgs.push({
|
|
247
|
+
start: a[i],
|
|
248
|
+
count: 1
|
|
249
|
+
});
|
|
250
|
+
}else if(isRange(a[i])){
|
|
251
|
+
rgs.push(a[i]);
|
|
252
|
+
}else if(isString(a)){
|
|
253
|
+
ids.push(a[i]);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}else if(isString(a)){
|
|
257
|
+
ids.push(a);
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
if(args && (args.index || args.range || args.id)){
|
|
261
|
+
f(args.index);
|
|
262
|
+
f(args.range);
|
|
263
|
+
if(isArrayLike(args.id)){
|
|
264
|
+
for(i = args.id.length - 1; i >= 0; --i){
|
|
265
|
+
ids.push(args.id[i]);
|
|
266
|
+
}
|
|
267
|
+
}else if(isId(args.id)){
|
|
268
|
+
ids.push(args.id);
|
|
269
|
+
}
|
|
270
|
+
}else{
|
|
271
|
+
f(args);
|
|
272
|
+
}
|
|
273
|
+
if(!rgs.length && !ids.length && self.size() < 0){
|
|
274
|
+
//first time load, try to load a page
|
|
275
|
+
rgs.push({start: 0, count: self._cache.pageSize || 1});
|
|
276
|
+
}
|
|
277
|
+
return res;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
return declare([], {
|
|
281
|
+
constructor: function(args){
|
|
282
|
+
var t = this,
|
|
283
|
+
cacheClass = args.cacheClass;
|
|
284
|
+
cacheClass = typeof cacheClass == 'string' ? require(cacheClass) : cacheClass;
|
|
285
|
+
t.store = args.store;
|
|
286
|
+
t._exts = {};
|
|
287
|
+
t._cmdQueue = [];
|
|
288
|
+
t._model = t._cache = new cacheClass(t, args);
|
|
289
|
+
t._createExts(args.modelExtensions || [], args);
|
|
290
|
+
var m = t._model;
|
|
291
|
+
t._cnnts = [
|
|
292
|
+
aspect.after(m, "onDelete", lang.hitch(t, "onDelete"), 1),
|
|
293
|
+
aspect.after(m, "onNew", lang.hitch(t, "onNew"), 1),
|
|
294
|
+
aspect.after(m, "onSet", lang.hitch(t, "onSet"), 1)
|
|
295
|
+
];
|
|
296
|
+
},
|
|
297
|
+
|
|
298
|
+
destroy: function(){
|
|
299
|
+
array.forEach(this._cnnts, function(cnnt){
|
|
300
|
+
cnnt.remove();
|
|
301
|
+
});
|
|
302
|
+
for(var n in this._exts){
|
|
303
|
+
this._exts[n].destroy();
|
|
304
|
+
}
|
|
305
|
+
this._cache.destroy();
|
|
306
|
+
},
|
|
307
|
+
|
|
308
|
+
clearCache: function(){
|
|
309
|
+
this._cache.clear();
|
|
310
|
+
},
|
|
311
|
+
|
|
312
|
+
isId: isId,
|
|
313
|
+
|
|
314
|
+
setStore: function(store){
|
|
315
|
+
this.store = store;
|
|
316
|
+
this._cache.setStore(store);
|
|
317
|
+
},
|
|
318
|
+
|
|
319
|
+
//Public-------------------------------------------------------------------
|
|
320
|
+
when: function(args, callback, scope){
|
|
321
|
+
this._oldSize = this.size();
|
|
322
|
+
this._addCmd({
|
|
323
|
+
name: '_cmdRequest',
|
|
324
|
+
scope: this,
|
|
325
|
+
args: arguments,
|
|
326
|
+
async: 1
|
|
327
|
+
});
|
|
328
|
+
return this._exec();
|
|
329
|
+
},
|
|
330
|
+
|
|
331
|
+
scan: function(args, callback){
|
|
332
|
+
var d = new Deferred,
|
|
333
|
+
start = args.start || 0,
|
|
334
|
+
pageSize = args.pageSize || this._cache.pageSize || 1,
|
|
335
|
+
count = args.count,
|
|
336
|
+
end = count > 0 ? start + count : Infinity,
|
|
337
|
+
scope = args.whenScope || this,
|
|
338
|
+
whenFunc = args.whenFunc || scope.when;
|
|
339
|
+
var f = function(s){
|
|
340
|
+
d.progress(s / (count > 0 ? s + count : scope.size()));
|
|
341
|
+
whenFunc.call(scope, {
|
|
342
|
+
id: [],
|
|
343
|
+
range: [{
|
|
344
|
+
start: s,
|
|
345
|
+
count: pageSize
|
|
346
|
+
}]
|
|
347
|
+
}, function(){
|
|
348
|
+
var i, r, rows = [];
|
|
349
|
+
for(i = s; i < s + pageSize && i < end; ++i){
|
|
350
|
+
r = scope.byIndex(i);
|
|
351
|
+
if(r){
|
|
352
|
+
rows.push(r);
|
|
353
|
+
}else{
|
|
354
|
+
end = -1;
|
|
355
|
+
break;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
if(callback(rows, s) || i == end){
|
|
359
|
+
end = -1;
|
|
360
|
+
}
|
|
361
|
+
}).then(function(){
|
|
362
|
+
if(end == -1){
|
|
363
|
+
d.callback();
|
|
364
|
+
}else{
|
|
365
|
+
f(s + pageSize);
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
};
|
|
369
|
+
f(start);
|
|
370
|
+
return d;
|
|
371
|
+
},
|
|
372
|
+
|
|
373
|
+
//Events---------------------------------------------------------------------------------
|
|
374
|
+
onDelete: function(/*id, index*/){},
|
|
375
|
+
|
|
376
|
+
onNew: function(/*id, index, row*/){},
|
|
377
|
+
|
|
378
|
+
onSet: function(/*id, index, row*/){},
|
|
379
|
+
|
|
380
|
+
onSizeChange: function(/*size, oldSize*/){},
|
|
381
|
+
|
|
382
|
+
//Package----------------------------------------------------------------------------
|
|
383
|
+
_msg: function(/* msg */){},
|
|
384
|
+
|
|
385
|
+
_addCmd: function(args){
|
|
386
|
+
//Add command to the command queue, and combine same kind of commands if possible.
|
|
387
|
+
var cmds = this._cmdQueue,
|
|
388
|
+
cmd = cmds[cmds.length - 1];
|
|
389
|
+
if(cmd && cmd.name == args.name && cmd.scope == args.scope){
|
|
390
|
+
cmd.args.push(args.args || []);
|
|
391
|
+
}else{
|
|
392
|
+
args.args = [args.args || []];
|
|
393
|
+
cmds.push(args);
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
|
|
397
|
+
//Private----------------------------------------------------------------------------
|
|
398
|
+
_onSizeChange: function(){
|
|
399
|
+
var t = this,
|
|
400
|
+
oldSize = t._oldSize,
|
|
401
|
+
size = t._oldSize = t.size();
|
|
402
|
+
if(oldSize != size){
|
|
403
|
+
t.onSizeChange(size, oldSize);
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
|
|
407
|
+
_cmdRequest: function(){
|
|
408
|
+
var t = this;
|
|
409
|
+
return new DeferredList(array.map(arguments, function(args){
|
|
410
|
+
var arg = args[0],
|
|
411
|
+
finish = function(){
|
|
412
|
+
t._onSizeChange();
|
|
413
|
+
//TODO: fire events here
|
|
414
|
+
//args[1] is callback, args[2] is scope
|
|
415
|
+
if(args[1]){
|
|
416
|
+
args[1].call(args[2]);
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
if(arg === null || !args.length){
|
|
420
|
+
var d = new Deferred;
|
|
421
|
+
finish();
|
|
422
|
+
d.callback();
|
|
423
|
+
return d;
|
|
424
|
+
}
|
|
425
|
+
return t._model._call('when', [normArgs(t, arg), finish]);
|
|
426
|
+
}), 0, 1);
|
|
427
|
+
},
|
|
428
|
+
|
|
429
|
+
_exec: function(){
|
|
430
|
+
//Execute commands one by one.
|
|
431
|
+
var t = this,
|
|
432
|
+
c = t._cache,
|
|
433
|
+
d = new Deferred,
|
|
434
|
+
cmds = t._cmdQueue,
|
|
435
|
+
finish = function(d, err){
|
|
436
|
+
t._busy = 0;
|
|
437
|
+
if(c._checkSize){
|
|
438
|
+
c._checkSize();
|
|
439
|
+
}
|
|
440
|
+
if(err){
|
|
441
|
+
d.errback(err);
|
|
442
|
+
}else{
|
|
443
|
+
d.callback();
|
|
444
|
+
}
|
|
445
|
+
},
|
|
446
|
+
func = function(){
|
|
447
|
+
if(array.some(cmds, function(cmd){
|
|
448
|
+
return cmd.name == '_cmdRequest';
|
|
449
|
+
})){
|
|
450
|
+
try{
|
|
451
|
+
while(cmds.length){
|
|
452
|
+
var cmd = cmds.shift(),
|
|
453
|
+
dd = cmd.scope[cmd.name].apply(cmd.scope, cmd.args);
|
|
454
|
+
if(cmd.async){
|
|
455
|
+
Deferred.when(dd, func, lang.partial(finish, d));
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}catch(e){
|
|
460
|
+
finish(d, e);
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
finish(d);
|
|
465
|
+
};
|
|
466
|
+
if(t._busy){
|
|
467
|
+
return t._busy;
|
|
468
|
+
}
|
|
469
|
+
t._busy = d;
|
|
470
|
+
func();
|
|
471
|
+
return d;
|
|
472
|
+
},
|
|
473
|
+
|
|
474
|
+
_createExts: function(exts, args){
|
|
475
|
+
//Ensure the given extensions are valid
|
|
476
|
+
exts = array.filter(array.map(exts, function(ext){
|
|
477
|
+
return typeof ext == 'string' ? require(ext) : ext;
|
|
478
|
+
}), function(ext){
|
|
479
|
+
return ext && ext.prototype;
|
|
480
|
+
});
|
|
481
|
+
//Sort the extensions by priority
|
|
482
|
+
exts.sort(function(a, b){
|
|
483
|
+
return a.prototype.priority - b.prototype.priority;
|
|
484
|
+
});
|
|
485
|
+
for(var i = 0, len = exts.length; i < len; ++i){
|
|
486
|
+
//Avoid duplicated extensions
|
|
487
|
+
//IMPORTANT: Assume extensions all have different priority values!
|
|
488
|
+
if(i == exts.length - 1 || exts[i] != exts[i + 1]){
|
|
489
|
+
var ext = new exts[i](this, args);
|
|
490
|
+
this._exts[ext.name] = ext;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
});
|
|
495
|
+
});
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
define([
|
|
2
|
+
'dojo/_base/declare',
|
|
3
|
+
"dojo/_base/lang",
|
|
4
|
+
'dojo/aspect'
|
|
5
|
+
], function(declare, lang, aspect){
|
|
6
|
+
|
|
7
|
+
/*=====
|
|
8
|
+
return declare([], {
|
|
9
|
+
// summary:
|
|
10
|
+
// Abstract base class for all model components (including cache)
|
|
11
|
+
|
|
12
|
+
onNew: function(){},
|
|
13
|
+
onDelete: function(){},
|
|
14
|
+
onSet: function(){}
|
|
15
|
+
});
|
|
16
|
+
=====*/
|
|
17
|
+
|
|
18
|
+
return declare([], {
|
|
19
|
+
constructor: function(model){
|
|
20
|
+
var t = this,
|
|
21
|
+
i = t.inner = model._model;
|
|
22
|
+
t._cnnts = [];
|
|
23
|
+
t.model = model;
|
|
24
|
+
model._model = t;
|
|
25
|
+
if(i){
|
|
26
|
+
t.aspect(i, 'onDelete', '_onDelete');
|
|
27
|
+
t.aspect(i, 'onNew', '_onNew');
|
|
28
|
+
t.aspect(i, 'onSet', '_onSet');
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
destroy: function(){
|
|
33
|
+
for(var i = 0, len = this._cnnts.length; i < len; ++i){
|
|
34
|
+
this._cnnts[i].remove();
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
aspect: function(obj, e, method, scope, pos){
|
|
39
|
+
var cnnt = aspect[pos || 'after'](obj, e, lang.hitch(scope || this, method), 1);
|
|
40
|
+
this._cnnts.push(cnnt);
|
|
41
|
+
return cnnt;
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
//Events----------------------------------------------------------------------
|
|
45
|
+
//Make sure every extension has the oppotunity to decide when to fire an event at its level.
|
|
46
|
+
_onNew: function(){
|
|
47
|
+
this.onNew.apply(this, arguments);
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
_onSet: function(){
|
|
51
|
+
this.onSet.apply(this, arguments);
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
_onDelete: function(){
|
|
55
|
+
this.onDelete.apply(this, arguments);
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
onNew: function(){},
|
|
59
|
+
onDelete: function(){},
|
|
60
|
+
onSet: function(){},
|
|
61
|
+
|
|
62
|
+
//Protected-----------------------------------------------------------------
|
|
63
|
+
_call: function(method, args){
|
|
64
|
+
var t = this,
|
|
65
|
+
m = t[method],
|
|
66
|
+
n = t.inner;
|
|
67
|
+
return m ? m.apply(t, args || []) : n && n._call(method, args);
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
_mixinAPI: function(){
|
|
71
|
+
var i,
|
|
72
|
+
m = this.model,
|
|
73
|
+
args = arguments,
|
|
74
|
+
api = function(method){
|
|
75
|
+
return function(){
|
|
76
|
+
return m._model._call(method, arguments);
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
for(i = args.length - 1; i >= 0; --i){
|
|
80
|
+
m[args[i]] = api(args[i]);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
});
|