gridx-rails 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- 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,409 @@
|
|
1
|
+
define([
|
2
|
+
"dojo/_base/declare",
|
3
|
+
"dojo/_base/lang",
|
4
|
+
"dojo/query",
|
5
|
+
"dojo/_base/array",
|
6
|
+
"dojo/dom-construct",
|
7
|
+
"dojo/dom-class",
|
8
|
+
"dojo/_base/Deferred",
|
9
|
+
"dojo/_base/sniff",
|
10
|
+
"dojo/keys",
|
11
|
+
"dijit/a11y",
|
12
|
+
"./Body",
|
13
|
+
"dojo/touch",
|
14
|
+
"dojo/i18n",
|
15
|
+
"dojo/i18n!../nls/Body"
|
16
|
+
], function(declare, lang, query, array, domConstruct, domClass, Deferred, has, keys, a11y, Body, touch, i18n){
|
17
|
+
|
18
|
+
/*=====
|
19
|
+
return declare(Body, {
|
20
|
+
// summary:
|
21
|
+
// This module provides a "load more" button (and a "load previous" button if necessary) inside grid body.
|
22
|
+
// description:
|
23
|
+
// Page size can be set to indicate how many rows to show in one page. Clicking "load more" button or
|
24
|
+
// "load previous" button loads a new page. If the current visible page count exceeds the max allowed page count,
|
25
|
+
// Some previous pages will be destroyed and "load previous" button will be shown.
|
26
|
+
// This module is designed especially for mobile devices, so it should almost always be used together with TouchVScroller.
|
27
|
+
// NOTE: This module is NOT compatible with VirtualVScroller and Pagination.
|
28
|
+
|
29
|
+
// maxPageCount: Integer
|
30
|
+
// The max allowed page count. If this value > 0, when visible pages exceeds this value, some previous pages will be destroyed
|
31
|
+
// and the "load previous" button will be shown. If this value <= 0, grid will never destroy and previous pages,
|
32
|
+
// and the "load previous" button will never be shown. Default to 0.
|
33
|
+
maxPageCount: 0,
|
34
|
+
|
35
|
+
// pageSize: Integer
|
36
|
+
// The row count in one page. Default to the pageSize of grid cache. If using cache has no pageSize, default to 20.
|
37
|
+
// Users can directly set grid parameter pageSize to set both the cache pageSize and the body pageSize.
|
38
|
+
// If using bodyPageSize, it'll be different from the cache page size, but that's also okay.
|
39
|
+
pageSize: 20,
|
40
|
+
});
|
41
|
+
=====*/
|
42
|
+
|
43
|
+
return declare(Body, {
|
44
|
+
maxPageCount: 0,
|
45
|
+
|
46
|
+
preload: function(){
|
47
|
+
var t = this,
|
48
|
+
g = t.grid,
|
49
|
+
view = g.view;
|
50
|
+
t._nls = i18n.getLocalization('gridx', 'Body', g.lang);
|
51
|
+
view.paging = 1;
|
52
|
+
view.rootStart = 0;
|
53
|
+
view.rootCount = this.arg('pageSize', t.model._cache.pageSize || 20);
|
54
|
+
domClass.remove(t.domNode, 'gridxBodyRowHoverEffect');
|
55
|
+
t.connect(t.domNode, 'onscroll', function(e){
|
56
|
+
g.hScrollerNode.scrollLeft = t.domNode.scrollLeft;
|
57
|
+
});
|
58
|
+
|
59
|
+
t._moreNode = domConstruct.create('div', {
|
60
|
+
'class': 'gridxLoadMore'
|
61
|
+
});
|
62
|
+
t.arg('createMoreNode').call(t, t._moreNode);
|
63
|
+
t._prevNode = domConstruct.create('div', {
|
64
|
+
'class': 'gridxLoadMore'
|
65
|
+
});
|
66
|
+
t.arg('createPrevNode').call(t, t._prevNode);
|
67
|
+
|
68
|
+
t.connect(t._moreNode, 'onmouseover', function(){
|
69
|
+
query('> .gridxRowOver', t.domNode).removeClass('gridxRowOver');
|
70
|
+
});
|
71
|
+
t.connect(t._prevNode, 'onmouseover', function(){
|
72
|
+
query('> .gridxRowOver', t.domNode).removeClass('gridxRowOver');
|
73
|
+
});
|
74
|
+
t._initFocus();
|
75
|
+
},
|
76
|
+
|
77
|
+
_initFocus: function(){
|
78
|
+
var t = this,
|
79
|
+
focus = t.grid.focus,
|
80
|
+
doFocus = function(node, evt, step){
|
81
|
+
if(node.parentNode){
|
82
|
+
focus.stopEvent(evt);
|
83
|
+
var elems = a11y._getTabNavigable(node),
|
84
|
+
n = elems[step < 0 ? 'last' : 'first'];
|
85
|
+
if(n){
|
86
|
+
n.focus();
|
87
|
+
}
|
88
|
+
return !!n;
|
89
|
+
}else{
|
90
|
+
return false;
|
91
|
+
}
|
92
|
+
},
|
93
|
+
doBlur = function(node, evt, step){
|
94
|
+
if(node.parentNode){
|
95
|
+
var elems = a11y._getTabNavigable(node);
|
96
|
+
return evt ? evt.target == (step < 0 ? elems.first : elems.last) : true;
|
97
|
+
}else{
|
98
|
+
return true;
|
99
|
+
}
|
100
|
+
};
|
101
|
+
t.inherited(arguments);
|
102
|
+
focus.registerArea({
|
103
|
+
name: 'prevBtn',
|
104
|
+
priority: 0.9999,
|
105
|
+
focusNode: t._prevNode,
|
106
|
+
scope: t,
|
107
|
+
doFocus: lang.partial(doFocus, t._prevNode),
|
108
|
+
doBlur: lang.partial(doBlur, t._prevNode)
|
109
|
+
});
|
110
|
+
focus.registerArea({
|
111
|
+
name: 'moreBtn',
|
112
|
+
priority: 1.0001,
|
113
|
+
focusNode: t._moreNode,
|
114
|
+
scope: t,
|
115
|
+
doFocus: lang.partial(doFocus, t._moreNode),
|
116
|
+
doBlur: lang.partial(doBlur, t._moreNode)
|
117
|
+
});
|
118
|
+
},
|
119
|
+
|
120
|
+
createMoreNode: function(moreNode){
|
121
|
+
var t = this,
|
122
|
+
moreBtn = t._moreBtn = domConstruct.create('button', {
|
123
|
+
innerHTML: t.arg('loadMoreLabel', t._nls.loadMore)
|
124
|
+
}, moreNode, 'last');
|
125
|
+
t.connect(moreBtn, touch.press, function(){
|
126
|
+
t._load(1);
|
127
|
+
});
|
128
|
+
t.connect(moreBtn, 'onkeydown', function(evt){
|
129
|
+
if(evt.keyCode == keys.ENTER){
|
130
|
+
t._load(1);
|
131
|
+
}
|
132
|
+
});
|
133
|
+
},
|
134
|
+
|
135
|
+
createPrevNode: function(prevNode){
|
136
|
+
var t = this,
|
137
|
+
prevBtn = t._prevBtn = domConstruct.create('button', {
|
138
|
+
innerHTML: t.arg('loadPreviousLabel', t._nls.loadPrevious)
|
139
|
+
}, t._prevNode, 'last');
|
140
|
+
t.connect(prevBtn, touch.press, function(){
|
141
|
+
t._load();
|
142
|
+
});
|
143
|
+
t.connect(prevBtn, 'onkeydown', function(evt){
|
144
|
+
if(evt.keyCode == keys.ENTER){
|
145
|
+
t._load();
|
146
|
+
}
|
147
|
+
});
|
148
|
+
},
|
149
|
+
|
150
|
+
load: function(args){
|
151
|
+
var t = this,
|
152
|
+
view = t.grid.view;
|
153
|
+
t.aspect(t.model, 'onDelete', '_onDelete');
|
154
|
+
if(view._err){
|
155
|
+
t._loadFail(view._err);
|
156
|
+
}
|
157
|
+
t.loaded.callback();
|
158
|
+
},
|
159
|
+
|
160
|
+
refresh: function(start){
|
161
|
+
var t = this,
|
162
|
+
loadingNode = t.grid.loadingNode,
|
163
|
+
d = new Deferred();
|
164
|
+
delete t._err;
|
165
|
+
domClass.add(loadingNode, 'gridxLoading');
|
166
|
+
t.grid.view.updateVisualCount().then(function(){
|
167
|
+
try{
|
168
|
+
t.renderStart = 0;
|
169
|
+
var rc = t.renderCount = t.grid.view.visualCount;
|
170
|
+
if(typeof start == 'number' && start >= 0){
|
171
|
+
var count = rc - start,
|
172
|
+
n = query('> [visualindex="' + start + '"]', t.domNode)[0],
|
173
|
+
uncachedRows = [],
|
174
|
+
renderedRows = [],
|
175
|
+
rows = t._buildRows(start, count, uncachedRows, renderedRows);
|
176
|
+
if(rows){
|
177
|
+
domConstruct.place(rows, n || t._moreNode, 'before');
|
178
|
+
}
|
179
|
+
while(n && n !== t._moreNode){
|
180
|
+
var tmp = n.nextSibling,
|
181
|
+
vidx = parseInt(n.getAttribute('visualindex'), 10),
|
182
|
+
id = n.getAttribute('rowid');
|
183
|
+
domConstruct.destroy(n);
|
184
|
+
if(vidx >= start + count){
|
185
|
+
t.onUnrender(id);
|
186
|
+
}
|
187
|
+
n = tmp;
|
188
|
+
}
|
189
|
+
array.forEach(renderedRows, t.onAfterRow, t);
|
190
|
+
Deferred.when(t._buildUncachedRows(uncachedRows), function(){
|
191
|
+
t.onRender(start, count);
|
192
|
+
domClass.remove(loadingNode, 'gridxLoading');
|
193
|
+
d.callback();
|
194
|
+
});
|
195
|
+
}else{
|
196
|
+
t.renderRows(0, rc, 0, 1);
|
197
|
+
domClass.remove(loadingNode, 'gridxLoading');
|
198
|
+
d.callback();
|
199
|
+
}
|
200
|
+
}catch(e){
|
201
|
+
t._loadFail(e);
|
202
|
+
domClass.remove(loadingNode, 'gridxLoading');
|
203
|
+
d.errback(e);
|
204
|
+
}
|
205
|
+
}, function(e){
|
206
|
+
t._loadFail(e);
|
207
|
+
domClass.remove(loadingNode, 'gridxLoading');
|
208
|
+
d.errback(e);
|
209
|
+
});
|
210
|
+
return d;
|
211
|
+
},
|
212
|
+
|
213
|
+
renderRows: function(start, count, position){
|
214
|
+
var t = this,
|
215
|
+
g = t.grid,
|
216
|
+
uncachedRows = [],
|
217
|
+
renderedRows = [],
|
218
|
+
n = t.domNode,
|
219
|
+
en = g.emptyNode;
|
220
|
+
if(t._err){
|
221
|
+
return;
|
222
|
+
}
|
223
|
+
if(count > 0){
|
224
|
+
en.innerHTML = t.arg('loadingInfo', t._nls.loadingInfo);
|
225
|
+
en.style.zIndex = '';
|
226
|
+
var str = t._buildRows(start, count, uncachedRows, renderedRows);
|
227
|
+
t.renderStart = start;
|
228
|
+
t.renderCount = count;
|
229
|
+
n.scrollTop = 0;
|
230
|
+
if(has('ie')){
|
231
|
+
//In IE, setting innerHTML will completely destroy the node,
|
232
|
+
//But CellWidget still need it.
|
233
|
+
while(n.childNodes.length){
|
234
|
+
n.removeChild(n.firstChild);
|
235
|
+
}
|
236
|
+
}
|
237
|
+
n.innerHTML = str;
|
238
|
+
if(g.view.rootStart + g.view.rootCount < g.model.size()){
|
239
|
+
n.appendChild(t._moreNode);
|
240
|
+
}
|
241
|
+
n.scrollLeft = g.hScrollerNode.scrollLeft;
|
242
|
+
if(!str){
|
243
|
+
en.style.zIndex = 1;
|
244
|
+
}else{
|
245
|
+
en.innerHTML = '';
|
246
|
+
}
|
247
|
+
t.onUnrender();
|
248
|
+
array.forEach(renderedRows, t.onAfterRow, t);
|
249
|
+
Deferred.when(t._buildUncachedRows(uncachedRows), function(){
|
250
|
+
t.onRender(start, count);
|
251
|
+
});
|
252
|
+
}else if(!{top: 1, bottom: 1}[position]){
|
253
|
+
n.scrollTop = 0;
|
254
|
+
if(has('ie')){
|
255
|
+
//In IE, setting innerHTML will completely destroy the node,
|
256
|
+
//But CellWidget still need it.
|
257
|
+
while(n.childNodes.length){
|
258
|
+
n.removeChild(n.firstChild);
|
259
|
+
}
|
260
|
+
}
|
261
|
+
n.innerHTML = '';
|
262
|
+
en.innerHTML = t.arg('emptyInfo', t._nls.emptyInfo);
|
263
|
+
en.style.zIndex = 1;
|
264
|
+
t.onUnrender();
|
265
|
+
t.onEmpty();
|
266
|
+
t.model.free();
|
267
|
+
}
|
268
|
+
},
|
269
|
+
|
270
|
+
onRender: function(/*start, count*/){
|
271
|
+
//FIX #8746
|
272
|
+
var bn = this.domNode;
|
273
|
+
if(has('ie') < 9 && bn.childNodes.length){
|
274
|
+
query('> gridxLastRow', bn).removeClass('gridxLastRow');
|
275
|
+
if(bn.lastChild !== this._moreNode){
|
276
|
+
domClass.add(bn.lastChild, 'gridxLastRow');
|
277
|
+
}
|
278
|
+
}
|
279
|
+
},
|
280
|
+
|
281
|
+
_load: function(isPost){
|
282
|
+
var t = this,
|
283
|
+
g = t.grid,
|
284
|
+
m = t.model,
|
285
|
+
view = g.view,
|
286
|
+
pageSize = t.arg('pageSize'),
|
287
|
+
btnNode = isPost ? t._moreNode : t._prevNode,
|
288
|
+
start = view.rootStart,
|
289
|
+
count = view.rootCount,
|
290
|
+
newRootStart = isPost ? start : start < pageSize ? 0 : start - pageSize,
|
291
|
+
newRootCount = isPost ? count + pageSize : start + count - newRootStart,
|
292
|
+
finish = function(renderStart, renderCount){
|
293
|
+
t._busy(isPost);
|
294
|
+
t._checkSize(!isPost, function(){
|
295
|
+
query('.gridxBodyFirstRow').removeClass('gridxBodyFirstRow');
|
296
|
+
var firstRow = t._prevNode.nextSibling;
|
297
|
+
if(firstRow && firstRow != t._moreNode){
|
298
|
+
domClass.add(firstRow, 'gridxBodyFirstRow');
|
299
|
+
}
|
300
|
+
t.onRender(renderStart, renderCount);
|
301
|
+
});
|
302
|
+
};
|
303
|
+
t._busy(isPost, 1);
|
304
|
+
m.when({
|
305
|
+
start: isPost ? start + count : newRootStart,
|
306
|
+
count: isPost ? pageSize : start - newRootStart
|
307
|
+
}, function(){
|
308
|
+
var totalCount = m.size();
|
309
|
+
if(isPost && newRootStart + newRootCount > totalCount){
|
310
|
+
newRootCount = totalCount - newRootStart;
|
311
|
+
}
|
312
|
+
view.updateRootRange(newRootStart, newRootCount).then(function(){
|
313
|
+
var renderStart = isPost ? t.renderCount : 0,
|
314
|
+
renderCount = view.visualCount - t.renderCount;
|
315
|
+
t.renderStart = 0;
|
316
|
+
t.renderCount = view.visualCount;
|
317
|
+
if(renderCount){
|
318
|
+
var toFetch = [];
|
319
|
+
for(var i = 0; i < renderCount; ++i){
|
320
|
+
var rowInfo = view.getRowInfo({visualIndex: renderStart + i});
|
321
|
+
if(!m.isId(rowInfo.id)){
|
322
|
+
toFetch.push({
|
323
|
+
parentId: rowInfo.parentId,
|
324
|
+
start: rowInfo.rowIndex,
|
325
|
+
count: 1
|
326
|
+
});
|
327
|
+
}
|
328
|
+
}
|
329
|
+
m.when(toFetch, function(){
|
330
|
+
var renderedRows = [],
|
331
|
+
scrollHeight = g.bodyNode.scrollHeight;
|
332
|
+
str = t._buildRows(renderStart, renderCount, [], renderedRows);
|
333
|
+
domConstruct.place(str, btnNode, isPost ? 'before' : 'after');
|
334
|
+
if(!isPost){
|
335
|
+
g.bodyNode.scrollTop += g.bodyNode.scrollHeight - scrollHeight;
|
336
|
+
}
|
337
|
+
if(isPost ? view.rootStart + view.rootCount >= totalCount : view.rootStart === 0){
|
338
|
+
t.domNode.removeChild(btnNode);
|
339
|
+
}
|
340
|
+
array.forEach(renderedRows, t.onAfterRow, t);
|
341
|
+
finish(renderStart, renderCount);
|
342
|
+
});
|
343
|
+
}else{
|
344
|
+
t.domNode.removeChild(btnNode);
|
345
|
+
if(!isPost){
|
346
|
+
query('.gridxBodyFirstRow').removeClass('gridxBodyFirstRow');
|
347
|
+
}
|
348
|
+
finish(renderStart, renderCount);
|
349
|
+
}
|
350
|
+
});
|
351
|
+
});
|
352
|
+
},
|
353
|
+
|
354
|
+
_checkSize: function(isPost, onFinish){
|
355
|
+
var t = this,
|
356
|
+
view = t.grid.view,
|
357
|
+
maxPageCount = t.arg('maxPageCount'),
|
358
|
+
maxRowCount = maxPageCount * t.arg('pageSize'),
|
359
|
+
btnNode = isPost ? t._moreNode : t._prevNode;
|
360
|
+
if(maxPageCount > 0 && view.rootCount > maxRowCount){
|
361
|
+
var newRootStart = isPost ? view.rootStart : view.rootStart + view.rootCount - maxRowCount;
|
362
|
+
view.updateRootRange(newRootStart, maxRowCount).then(function(){
|
363
|
+
if(btnNode.parentNode){
|
364
|
+
btnNode.parentNode.removeChild(btnNode);
|
365
|
+
}
|
366
|
+
t.unrenderRows(t.renderCount - view.visualCount, isPost ? 'post' : '');
|
367
|
+
t.renderStart = 0;
|
368
|
+
t.renderCount = view.visualCount;
|
369
|
+
query('.gridxRow', t.domNode).forEach(function(node, i){
|
370
|
+
node.setAttribute('visualindex', i);
|
371
|
+
});
|
372
|
+
domConstruct.place(btnNode, t.domNode, isPost ? 'last' : 'first');
|
373
|
+
if(!isPost){
|
374
|
+
t.grid.vScroller.scrollToRow(view.visualCount - 1);
|
375
|
+
}
|
376
|
+
onFinish();
|
377
|
+
});
|
378
|
+
}else{
|
379
|
+
onFinish();
|
380
|
+
}
|
381
|
+
},
|
382
|
+
|
383
|
+
_busy: function(isPost, begin){
|
384
|
+
var t = this,
|
385
|
+
btn = isPost ? t._moreBtn : t._prevBtn,
|
386
|
+
cls = isPost ? "More" : "Previous";
|
387
|
+
btn.innerHTML = begin ?
|
388
|
+
'<span class="gridxLoadingMore"></span>' + t.arg('load' + cls + 'LoadingLabel', t._nls['load' + cls + 'Loading']) :
|
389
|
+
t.arg('load' + cls + 'Label', t._nls['load' + cls]);
|
390
|
+
btn.disabled = !!begin;
|
391
|
+
},
|
392
|
+
|
393
|
+
_onDelete: function(id){
|
394
|
+
var t = this,
|
395
|
+
view = t.grid.view;
|
396
|
+
if(t.autoUpdate){
|
397
|
+
var node = t.getRowNode({rowId: id});
|
398
|
+
if(node){
|
399
|
+
var parentId = node.getAttribute('parentid'),
|
400
|
+
rowIndex = parseInt(node.getAttribute('rowindex'), 10);
|
401
|
+
if(parentId === '' && rowIndex >= view.rootStart && rowIndex < view.rootStart + view.rootCount){
|
402
|
+
view.updateRootRange(view.rootStart, view.rootCount - 1);
|
403
|
+
}
|
404
|
+
}
|
405
|
+
}
|
406
|
+
t.inherited(arguments);
|
407
|
+
}
|
408
|
+
});
|
409
|
+
});
|
@@ -0,0 +1,293 @@
|
|
1
|
+
define([
|
2
|
+
"dojo/_base/declare",
|
3
|
+
"dojo/_base/array",
|
4
|
+
"../core/_Module"
|
5
|
+
], function(declare, array, _Module){
|
6
|
+
|
7
|
+
/*=====
|
8
|
+
return declare(_Module, {
|
9
|
+
// summary:
|
10
|
+
// This module provides (logical) pagination functionality for grid.
|
11
|
+
// description:
|
12
|
+
// This module does not include any UI buttons for pagination, so that various
|
13
|
+
// kinds of pagination UI implementations can benifit from this module.
|
14
|
+
|
15
|
+
|
16
|
+
// initialPageSize: Integer
|
17
|
+
// Specify the page size (row count per page) when the grid is created.
|
18
|
+
//initialPageSize: 10,
|
19
|
+
|
20
|
+
// initialPage: Integer
|
21
|
+
// Specify which page the grid should show when it is created.
|
22
|
+
//initialPage: 0,
|
23
|
+
|
24
|
+
pageSize: function(){
|
25
|
+
// summary:
|
26
|
+
// Get current page size
|
27
|
+
// returns:
|
28
|
+
// The current page size
|
29
|
+
},
|
30
|
+
|
31
|
+
isAll: function(){
|
32
|
+
// summary:
|
33
|
+
// Check if the grid is currently showing all rows (page size set to 0).
|
34
|
+
// returns:
|
35
|
+
// Whether the grid is showing all rows.
|
36
|
+
},
|
37
|
+
|
38
|
+
pageCount: function(){
|
39
|
+
// summary:
|
40
|
+
// Get the current count of pages.
|
41
|
+
// returns:
|
42
|
+
// The current count of pages.
|
43
|
+
},
|
44
|
+
|
45
|
+
currentPage: function(){
|
46
|
+
// summary:
|
47
|
+
// Get the index of current page.
|
48
|
+
// returns:
|
49
|
+
// The index of current page.
|
50
|
+
},
|
51
|
+
|
52
|
+
firstIndexInPage: function(page){
|
53
|
+
// summary:
|
54
|
+
// Get the index of the first row in the given page.
|
55
|
+
// page: Integer?
|
56
|
+
// The index of a page. If omitted, default to the current page.
|
57
|
+
// returns:
|
58
|
+
// The index of the first row in the page. If page is not valid, return -1.
|
59
|
+
},
|
60
|
+
|
61
|
+
lastIndexInPage: function(page){
|
62
|
+
// summary:
|
63
|
+
// Get the index of the last row in the given page.
|
64
|
+
// page: Integer
|
65
|
+
// The index of a page
|
66
|
+
// returns:
|
67
|
+
// The index of the last row in the given page.
|
68
|
+
},
|
69
|
+
|
70
|
+
pageOfIndex: function(index){
|
71
|
+
// summary:
|
72
|
+
// Get the index of the page that the given row is in.
|
73
|
+
// index: Integer
|
74
|
+
// The row index
|
75
|
+
// returns:
|
76
|
+
// The page index
|
77
|
+
},
|
78
|
+
|
79
|
+
indexInPage: function(index){
|
80
|
+
// summary:
|
81
|
+
// Get the row index in page by overall row index
|
82
|
+
// index: Integer
|
83
|
+
// The row index
|
84
|
+
// returns:
|
85
|
+
// The row index in page
|
86
|
+
},
|
87
|
+
|
88
|
+
filterIndexesInPage: function(indexes, page){
|
89
|
+
// summary:
|
90
|
+
// Filter out the indexes that are in the given page.
|
91
|
+
// indexes: Integer[]
|
92
|
+
// An array of row indexes.
|
93
|
+
// page: Integer
|
94
|
+
// A page index
|
95
|
+
// returns:
|
96
|
+
// A subset of indexes that appear in the given page.
|
97
|
+
},
|
98
|
+
|
99
|
+
gotoPage: function(page){
|
100
|
+
// summary:
|
101
|
+
// Set the current page
|
102
|
+
// page: Integer
|
103
|
+
// A page index
|
104
|
+
},
|
105
|
+
|
106
|
+
setPageSize: function(size){
|
107
|
+
// summary:
|
108
|
+
// Set page size (count of rows in one page)
|
109
|
+
// size: Integer
|
110
|
+
// The new page size
|
111
|
+
},
|
112
|
+
|
113
|
+
onSwitchPage: function(){
|
114
|
+
// summary:
|
115
|
+
// Fired when switched to another page.
|
116
|
+
// tags:
|
117
|
+
// callback
|
118
|
+
},
|
119
|
+
|
120
|
+
onChangePageSize: function(){
|
121
|
+
// summary:
|
122
|
+
// Fired when the page size is changed
|
123
|
+
// tags:
|
124
|
+
// callback
|
125
|
+
}
|
126
|
+
});
|
127
|
+
=====*/
|
128
|
+
|
129
|
+
return declare(_Module, {
|
130
|
+
name: 'pagination',
|
131
|
+
|
132
|
+
forced: ['view'],
|
133
|
+
|
134
|
+
rowMixin: {
|
135
|
+
getPage: function(){
|
136
|
+
// summary:
|
137
|
+
// Get the page index this row belongs to.
|
138
|
+
return this.grid.pagination.pageOfIndex(this.index());
|
139
|
+
},
|
140
|
+
|
141
|
+
indexInPage: function(){
|
142
|
+
// summary:
|
143
|
+
// Get the index of this row in its page.
|
144
|
+
return this.grid.pagination.indexInPage(this.index());
|
145
|
+
}
|
146
|
+
},
|
147
|
+
|
148
|
+
preload: function(){
|
149
|
+
this.grid.view.paging = true;
|
150
|
+
},
|
151
|
+
|
152
|
+
load: function(){
|
153
|
+
var t = this,
|
154
|
+
finish = function(){
|
155
|
+
t._updateBody(1);
|
156
|
+
t.connect(t.model, 'onSizeChange', '_onSizeChange');
|
157
|
+
t.loaded.callback();
|
158
|
+
};
|
159
|
+
t._pageSize = t.arg('initialPageSize') || t._pageSize;
|
160
|
+
t._page = t.arg('initialPage', t._page, function(arg){
|
161
|
+
return arg >= 0;
|
162
|
+
});
|
163
|
+
t.model.when({}).then(finish, finish);
|
164
|
+
},
|
165
|
+
|
166
|
+
// [Public API] --------------------------------------------------------
|
167
|
+
// GET functions
|
168
|
+
pageSize: function(){
|
169
|
+
var s = this._pageSize;
|
170
|
+
return s > 0 ? s : this.model.size();
|
171
|
+
},
|
172
|
+
|
173
|
+
isAll: function(){
|
174
|
+
return this._pageSize === 0;
|
175
|
+
},
|
176
|
+
|
177
|
+
pageCount: function(){
|
178
|
+
return this.isAll() ? 1 : Math.max(Math.ceil(this.model.size() / this.pageSize()), 1); //Integer
|
179
|
+
},
|
180
|
+
|
181
|
+
currentPage: function(){
|
182
|
+
return this._page;
|
183
|
+
},
|
184
|
+
|
185
|
+
firstIndexInPage: function(page){
|
186
|
+
if(!page && page !== 0){
|
187
|
+
page = this._page;
|
188
|
+
}else if(!(page >= 0)){
|
189
|
+
return -1; //Integer
|
190
|
+
}
|
191
|
+
var index = page * this.pageSize();
|
192
|
+
return index < this.model.size() ? index : -1;
|
193
|
+
},
|
194
|
+
|
195
|
+
lastIndexInPage: function(page){
|
196
|
+
var t = this,
|
197
|
+
firstIndex = t.firstIndexInPage(page);
|
198
|
+
if(firstIndex >= 0){
|
199
|
+
var lastIndex = firstIndex + t.pageSize() - 1,
|
200
|
+
size = t.model.size();
|
201
|
+
return lastIndex < size ? lastIndex : size - 1;
|
202
|
+
}
|
203
|
+
return -1;
|
204
|
+
},
|
205
|
+
|
206
|
+
pageOfIndex: function(index){
|
207
|
+
return this.isAll() ? 0 : Math.floor(index / this.pageSize());
|
208
|
+
},
|
209
|
+
|
210
|
+
indexInPage: function(index){
|
211
|
+
return this.isAll() ? index : index % this.pageSize();
|
212
|
+
},
|
213
|
+
|
214
|
+
filterIndexesInPage: function(indexes, page){
|
215
|
+
var first = this.firstIndexInPage(page),
|
216
|
+
end = this.lastIndexInPage(page);
|
217
|
+
return first < 0 ? [] : array.filter(indexes, function(index){
|
218
|
+
return index >= first && index <= end;
|
219
|
+
});
|
220
|
+
},
|
221
|
+
|
222
|
+
//SET functions
|
223
|
+
gotoPage: function(page){
|
224
|
+
var t = this, oldPage = t._page;
|
225
|
+
if(page != oldPage && t.firstIndexInPage(page) >= 0){
|
226
|
+
t._page = page;
|
227
|
+
t._updateBody();
|
228
|
+
t.onSwitchPage(page, oldPage);
|
229
|
+
}
|
230
|
+
},
|
231
|
+
|
232
|
+
setPageSize: function(size){
|
233
|
+
var t = this, oldSize = t._pageSize;
|
234
|
+
if(size != oldSize && size >= 0){
|
235
|
+
var index = t.firstIndexInPage(),
|
236
|
+
oldPage = -1;
|
237
|
+
t._pageSize = size;
|
238
|
+
if(t._page >= t.pageCount()){
|
239
|
+
oldPage = t._page;
|
240
|
+
t._page = t.pageOfIndex(index);
|
241
|
+
}
|
242
|
+
t._updateBody();
|
243
|
+
t.onChangePageSize(size, oldSize);
|
244
|
+
if(oldPage >= 0){
|
245
|
+
t.onSwitchPage(t._page, oldPage);
|
246
|
+
}
|
247
|
+
}
|
248
|
+
},
|
249
|
+
|
250
|
+
// [Events] ----------------------------------------------------------------
|
251
|
+
onSwitchPage: function(/*currentPage, originalPage*/){},
|
252
|
+
|
253
|
+
onChangePageSize: function(/*currentSize, originalSize*/){},
|
254
|
+
|
255
|
+
// [Private] -------------------------------------------------------
|
256
|
+
_page: 0,
|
257
|
+
|
258
|
+
_pageSize: 10,
|
259
|
+
|
260
|
+
_updateBody: function(noRefresh){
|
261
|
+
var t = this,
|
262
|
+
size = t.model.size(),
|
263
|
+
count = t.pageSize(),
|
264
|
+
start = t.firstIndexInPage();
|
265
|
+
if(size === 0 || start < 0){
|
266
|
+
start = 0;
|
267
|
+
count = 0;
|
268
|
+
}else if(size - start < count){
|
269
|
+
count = size - start;
|
270
|
+
}
|
271
|
+
t.grid.view.updateRootRange(start, count, 1);
|
272
|
+
if(!noRefresh){
|
273
|
+
t.grid.body.lazyRefresh();
|
274
|
+
}
|
275
|
+
},
|
276
|
+
|
277
|
+
_onSizeChange: function(size){
|
278
|
+
var t = this;
|
279
|
+
if(size === 0){
|
280
|
+
t._page = 0;
|
281
|
+
t.grid.view.updateRootRange(0, 0);
|
282
|
+
}else{
|
283
|
+
var first = t.firstIndexInPage();
|
284
|
+
if(first < 0 && t._page !== 0){
|
285
|
+
var oldPage = t._page;
|
286
|
+
t._page = 0;
|
287
|
+
t.onSwitchPage(0, oldPage);
|
288
|
+
}
|
289
|
+
t._updateBody();
|
290
|
+
}
|
291
|
+
}
|
292
|
+
});
|
293
|
+
});
|