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,429 @@
|
|
|
1
|
+
define([
|
|
2
|
+
"dojo/_base/declare",
|
|
3
|
+
"dojo/_base/lang",
|
|
4
|
+
"dojo/_base/Deferred",
|
|
5
|
+
"dojo/DeferredList",
|
|
6
|
+
/*====='../Model',=====*/
|
|
7
|
+
'../_Extension'
|
|
8
|
+
], function(declare, lang, Deferred, DeferredList,
|
|
9
|
+
/*=====Model, =====*/
|
|
10
|
+
_Extension){
|
|
11
|
+
|
|
12
|
+
/*=====
|
|
13
|
+
Model.move = function(){};
|
|
14
|
+
Model.moveIndexes = function(){};
|
|
15
|
+
Model.insert = function(){};
|
|
16
|
+
Model.onMoved = function(){};
|
|
17
|
+
|
|
18
|
+
return declare(_Extension, {
|
|
19
|
+
// summary:
|
|
20
|
+
// Move rows by means of sorting a special field (default to "order").
|
|
21
|
+
});
|
|
22
|
+
=====*/
|
|
23
|
+
|
|
24
|
+
var hitch = lang.hitch;
|
|
25
|
+
|
|
26
|
+
function getMoves(indexes, target){
|
|
27
|
+
//Transform arbitrary index array to an array of standard moves: [start, count, target].
|
|
28
|
+
var i, len, arr = [], moves = [], move,
|
|
29
|
+
beforeBegin = 1, afterBegin = 1,
|
|
30
|
+
beforeTarget = target, afterTarget = target, pos;
|
|
31
|
+
for(i = 0, len = indexes.length; i < len; ++i){
|
|
32
|
+
arr[indexes[i]] = 1;
|
|
33
|
+
}
|
|
34
|
+
for(i = 0, len = arr.length; i < len; ++i){
|
|
35
|
+
if(arr[i]){
|
|
36
|
+
if(i < target){
|
|
37
|
+
if(beforeBegin){
|
|
38
|
+
beforeBegin = 0;
|
|
39
|
+
move = [i, 1];
|
|
40
|
+
pos = moves.length;
|
|
41
|
+
moves.unshift(move);
|
|
42
|
+
}else if(arr[i - 1]){
|
|
43
|
+
++move[1];
|
|
44
|
+
}
|
|
45
|
+
}else{
|
|
46
|
+
if(afterBegin){
|
|
47
|
+
afterBegin = 0;
|
|
48
|
+
move = [i, 1, afterTarget];
|
|
49
|
+
moves.push(move);
|
|
50
|
+
++afterTarget;
|
|
51
|
+
}else if(arr[i - 1]){
|
|
52
|
+
++move[1];
|
|
53
|
+
++afterTarget;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}else{
|
|
57
|
+
beforeBegin = afterBegin = 1;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
for(i = 0; i <= pos; ++i){
|
|
61
|
+
move = moves[i];
|
|
62
|
+
move[2] = beforeTarget;
|
|
63
|
+
beforeTarget -= move[1];
|
|
64
|
+
}
|
|
65
|
+
return moves;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function mapIndex(start, count, target, map){
|
|
69
|
+
//Do the actual mapping index work.
|
|
70
|
+
var mapping = {}, from, to, i, revMap = {};
|
|
71
|
+
|
|
72
|
+
if(target > start + count){
|
|
73
|
+
//target is after the range
|
|
74
|
+
for(i = 0; i < count; ++i){
|
|
75
|
+
mapping[start + i] = target + i - count;
|
|
76
|
+
}
|
|
77
|
+
for(i = 0; i < target - start - count; ++i){
|
|
78
|
+
mapping[start + count + i] = start + i;
|
|
79
|
+
}
|
|
80
|
+
}else if(target < start){
|
|
81
|
+
//target is before the range
|
|
82
|
+
for(i = 0; i < count; ++i){
|
|
83
|
+
mapping[start + i] = target + i;
|
|
84
|
+
}
|
|
85
|
+
for(i = 0; i < start - target; ++i){
|
|
86
|
+
mapping[target + i] = target + i + count;
|
|
87
|
+
}
|
|
88
|
+
}else{
|
|
89
|
+
//target is in the range
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
for(from in map){
|
|
93
|
+
revMap[map[from]] = parseInt(from, 10);
|
|
94
|
+
}
|
|
95
|
+
for(from in mapping){
|
|
96
|
+
to = mapping[from];
|
|
97
|
+
if(revMap.hasOwnProperty(from)){
|
|
98
|
+
from = revMap[from];
|
|
99
|
+
}
|
|
100
|
+
if(from == to){
|
|
101
|
+
delete map[from];
|
|
102
|
+
}else{
|
|
103
|
+
map[from] = to;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return declare(_Extension, {
|
|
108
|
+
// Not compatible with Sort and Map extensions!
|
|
109
|
+
name: 'move',
|
|
110
|
+
|
|
111
|
+
priority: 10,
|
|
112
|
+
|
|
113
|
+
constructor: function(model, args){
|
|
114
|
+
var t = this, options = model._cache.options = model._cache.options || {};
|
|
115
|
+
t._mixinAPI('move', 'moveIndexes', 'insert');
|
|
116
|
+
model.onMoved = function(){};
|
|
117
|
+
//User can customize how to deal with moved rows by providing his own updateStore method.
|
|
118
|
+
if(args.updateStore){
|
|
119
|
+
t.updateStore = args.updateStore;
|
|
120
|
+
}
|
|
121
|
+
if(args.moveSortInfo){
|
|
122
|
+
//User can customize the whole sort info.
|
|
123
|
+
options.sort = args.moveSortInfo;
|
|
124
|
+
}else{
|
|
125
|
+
//Or just provide a field indicating the moving order (recommended)
|
|
126
|
+
options.sort = [{
|
|
127
|
+
attribute: t.moveField = args.moveField || 'order',
|
|
128
|
+
descending: t.moveFieldDescending = args.moveFieldDescending || false
|
|
129
|
+
}];
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
//Public---------------------------------------------------------------------
|
|
134
|
+
//moveField: 'order',
|
|
135
|
+
|
|
136
|
+
//moveFieldDescending: false,
|
|
137
|
+
|
|
138
|
+
//moveSortInfo: [],
|
|
139
|
+
|
|
140
|
+
move: function(start, count, target){
|
|
141
|
+
// summary
|
|
142
|
+
// Move rows by row index.
|
|
143
|
+
if(start >= 0 && start < Infinity &&
|
|
144
|
+
count > 0 && count < Infinity &&
|
|
145
|
+
target >= 0 && target < Infinity &&
|
|
146
|
+
(target < start || target > start + count)){
|
|
147
|
+
this.model._addCmd({
|
|
148
|
+
name: '_cmdMove',
|
|
149
|
+
scope: this,
|
|
150
|
+
args: [start, count, target],
|
|
151
|
+
async: 1
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
moveIndexes: function(indexes, target){
|
|
157
|
+
this.model._addCmd({
|
|
158
|
+
name: '_cmdMove',
|
|
159
|
+
scope: this,
|
|
160
|
+
args: [indexes, target],
|
|
161
|
+
async: 1
|
|
162
|
+
});
|
|
163
|
+
},
|
|
164
|
+
|
|
165
|
+
insert: function(dataArray, prevItem, nextItem){
|
|
166
|
+
var finished = new Deferred(),
|
|
167
|
+
success = hitch(finished, finished.callback),
|
|
168
|
+
fail = hitch(finished, finished.errback),
|
|
169
|
+
moveField = this.moveField,
|
|
170
|
+
store = this.model.store,
|
|
171
|
+
i, data, dl = [],
|
|
172
|
+
getValue = function(item){
|
|
173
|
+
return store.fetch ? store.getValue(item, moveField) : item[moveField];
|
|
174
|
+
},
|
|
175
|
+
prevValue = prevItem ? getValue(prevItem) : null,
|
|
176
|
+
nextValue = nextItem ? getValue(nextItem) : null;
|
|
177
|
+
for(i = 0; data = dataArray[i]; ++i){
|
|
178
|
+
if(prevValue === null && nextValue === null){
|
|
179
|
+
//No data in grid
|
|
180
|
+
prevValue = Math.random();
|
|
181
|
+
}else if(prevValue === null){
|
|
182
|
+
//Be first row in grid
|
|
183
|
+
prevValue = nextValue - 1;
|
|
184
|
+
}else if(nextValue === null){
|
|
185
|
+
//Be last row in grid
|
|
186
|
+
prevValue = prevValue + 1;
|
|
187
|
+
}else{
|
|
188
|
+
//Between 2 existing rows
|
|
189
|
+
prevValue = (prevValue + nextValue) / 2;
|
|
190
|
+
}
|
|
191
|
+
data[moveField] = prevValue;
|
|
192
|
+
if(store.fetch){
|
|
193
|
+
store.newItem(data);
|
|
194
|
+
}else{
|
|
195
|
+
var d = new Deferred();
|
|
196
|
+
Deferred.when(store.add(data), hitch(d, d.callback), hitch(d, d.errback));
|
|
197
|
+
dl.push(d);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
if(store.fetch){
|
|
201
|
+
store.save({
|
|
202
|
+
onComplete: success,
|
|
203
|
+
onError: fail
|
|
204
|
+
});
|
|
205
|
+
}else{
|
|
206
|
+
new DeferredList(dl).then(success, fail);
|
|
207
|
+
}
|
|
208
|
+
return finished;
|
|
209
|
+
},
|
|
210
|
+
|
|
211
|
+
updateStore: function(finishDef, moves, map){
|
|
212
|
+
// summary:
|
|
213
|
+
// Do the actual moving work here, that is to change the moveField of moved rows.
|
|
214
|
+
// User can overwrite this function to provide customized logic.
|
|
215
|
+
// Here a default implementation is provided. This implementation requires the
|
|
216
|
+
// moveField is a field of number type, and it can accept any number. In other words,
|
|
217
|
+
// this moveField is just a field to indicate row order without any other meanings.
|
|
218
|
+
// This default implementation tries to reduce the overall requests sent to store,
|
|
219
|
+
// because the current store implementation sends a separate PUT command to store for every
|
|
220
|
+
// single item one by one.
|
|
221
|
+
//
|
|
222
|
+
// Note: this is more like a public attribute rather than a public method, because users
|
|
223
|
+
// should assign a value to is rather can directly call it.
|
|
224
|
+
//
|
|
225
|
+
// finishDef: dojo.Deferred
|
|
226
|
+
// A Deferred object to indicate when the update is finished. finishDef.callback() or finishDef.errback()
|
|
227
|
+
// must be called in this function, otherwise the grid will break.
|
|
228
|
+
// moves: Array
|
|
229
|
+
// This is an array of arrays. Each element is an array of 3 numbers: startIndex, rowCount, targetIndex.
|
|
230
|
+
// These numbers represents a single movement operation, which has the following semantic:
|
|
231
|
+
// "rowCount" rows from index "startIndex" are moved to index "targetIndex"
|
|
232
|
+
// These movement operations take place in the given order, so the index in later movement is different from
|
|
233
|
+
// those in the previous movement, since it is based on the result of the previous movement.
|
|
234
|
+
// map: Association array
|
|
235
|
+
// An index mapping from the original indexes to the new indexes. This map is generated from the "moves" argument,
|
|
236
|
+
// so it has exactly the same information as "moves". But it is pre-processed to reflect the final index mapping
|
|
237
|
+
// after all these movements are done, so it might be easier to use.
|
|
238
|
+
var reverseIndexes = [], info = [], indexes = [], ranges = [],
|
|
239
|
+
from, to, m = {}, i, dif, cat = {}, mostDif, maxCount = 0, t = this,
|
|
240
|
+
inner = t.inner, store = t.model.store, moveField = t.moveField, dl = [],
|
|
241
|
+
|
|
242
|
+
findBefore = function(to){
|
|
243
|
+
if(to > 0){
|
|
244
|
+
return reverseIndexes[to - 1] === undefined ? to - 1 : reverseIndexes[to - 1];
|
|
245
|
+
}else{
|
|
246
|
+
return -1;
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
findAfter = function(to){
|
|
250
|
+
for(; to < reverseIndexes.length; ++to){
|
|
251
|
+
var from = reverseIndexes[to];
|
|
252
|
+
if(!info[from]){
|
|
253
|
+
return from === undefined ? to : from;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
return to;
|
|
257
|
+
},
|
|
258
|
+
getItem = function(index){
|
|
259
|
+
var row = inner._call('byIndex', [index]);
|
|
260
|
+
return row && row.item;
|
|
261
|
+
},
|
|
262
|
+
getValue = function(item){
|
|
263
|
+
return store.fetch ? store.getValue(item, moveField) : item[moveField];
|
|
264
|
+
},
|
|
265
|
+
calcValue = function(index, size){
|
|
266
|
+
var context = info[index];
|
|
267
|
+
if(context){
|
|
268
|
+
return context.value;
|
|
269
|
+
}else if(index < 0){
|
|
270
|
+
return getValue(getItem(0)) - 1;
|
|
271
|
+
}else if(index < size){
|
|
272
|
+
return getValue(getItem(index));
|
|
273
|
+
}else{
|
|
274
|
+
return getValue(getItem(size - 1)) + 1;
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
setValue = function(item, value){
|
|
278
|
+
if(store.fetch){
|
|
279
|
+
store.setValue(item, moveField, value);
|
|
280
|
+
}else{
|
|
281
|
+
item = lang.clone(item);
|
|
282
|
+
item[moveField] = value;
|
|
283
|
+
// console.log('setValue:', item, moveField, value);
|
|
284
|
+
var d = new Deferred();
|
|
285
|
+
Deferred.when(store.put(item, {
|
|
286
|
+
overwrite: true
|
|
287
|
+
}), hitch(d, d.callback));
|
|
288
|
+
dl.push(d);
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
saveStore = function(){
|
|
292
|
+
if(store.fetch){
|
|
293
|
+
store.save({
|
|
294
|
+
onComplete: function(){
|
|
295
|
+
finishDef.callback();
|
|
296
|
+
},
|
|
297
|
+
onError: function(e){
|
|
298
|
+
finishDef.errback(e);
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
}else{
|
|
302
|
+
(new DeferredList(dl)).then(function(){
|
|
303
|
+
finishDef.callback();
|
|
304
|
+
}, function(e){
|
|
305
|
+
finishDef.errback(e);
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
var first = Infinity;
|
|
311
|
+
for(from in map){
|
|
312
|
+
from = parseInt(from, 10);
|
|
313
|
+
to = map[from];
|
|
314
|
+
m[from] = to;
|
|
315
|
+
if(to < first){
|
|
316
|
+
first = to;
|
|
317
|
+
}
|
|
318
|
+
reverseIndexes[to] = from;
|
|
319
|
+
}
|
|
320
|
+
for(i = first; i < reverseIndexes.length; ++i){
|
|
321
|
+
if(reverseIndexes[i] === undefined){
|
|
322
|
+
reverseIndexes[i] = i;
|
|
323
|
+
m[i] = i;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
//Categorize mappings
|
|
327
|
+
for(from in m){
|
|
328
|
+
from = parseInt(from, 10);
|
|
329
|
+
to = m[from];
|
|
330
|
+
dif = to - from;
|
|
331
|
+
if(cat[dif] === undefined){
|
|
332
|
+
cat[dif] = 1;
|
|
333
|
+
}else{
|
|
334
|
+
++cat[dif];
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
//Find the category with most rows
|
|
338
|
+
for(dif in cat){
|
|
339
|
+
if(cat[dif] > maxCount){
|
|
340
|
+
maxCount = cat[dif];
|
|
341
|
+
mostDif = dif;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
//Find out the rows that need to update (all the rows not belong to the biggest category)
|
|
345
|
+
for(to = 0; to < reverseIndexes.length; ++to){
|
|
346
|
+
from = reverseIndexes[to];
|
|
347
|
+
if(from !== undefined && to - from != mostDif){
|
|
348
|
+
info[from] = {};
|
|
349
|
+
indexes.push(from);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
//For every row to change, find it's previous and next row in the final order.
|
|
353
|
+
for(i = 0; i < indexes.length; ++i){
|
|
354
|
+
from = indexes[i];
|
|
355
|
+
to = m[from];
|
|
356
|
+
var before = info[from].before = findBefore(to),
|
|
357
|
+
after = info[from].after = findAfter(to);
|
|
358
|
+
ranges.push({
|
|
359
|
+
start: from,
|
|
360
|
+
count: 1
|
|
361
|
+
}, {
|
|
362
|
+
start: after,
|
|
363
|
+
count: 1
|
|
364
|
+
});
|
|
365
|
+
if(before >= 0){
|
|
366
|
+
ranges.push({
|
|
367
|
+
start: before,
|
|
368
|
+
count: 1
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
// console.log('info:', info, cat);
|
|
373
|
+
//Apply the change to store.
|
|
374
|
+
inner._call('when', [{
|
|
375
|
+
id: [],
|
|
376
|
+
range: ranges
|
|
377
|
+
}, function(){
|
|
378
|
+
var size = inner._call('size');
|
|
379
|
+
for(var i = 0; i < indexes.length; ++i){
|
|
380
|
+
from = indexes[i];
|
|
381
|
+
var fromItem = getItem(from),
|
|
382
|
+
context = info[from],
|
|
383
|
+
beforeValue = calcValue(context.before, size),
|
|
384
|
+
afterValue = calcValue(context.after, size),
|
|
385
|
+
value = (beforeValue + afterValue) / 2;
|
|
386
|
+
context.value = value;
|
|
387
|
+
setValue(fromItem, value);
|
|
388
|
+
}
|
|
389
|
+
saveStore();
|
|
390
|
+
}]);
|
|
391
|
+
},
|
|
392
|
+
|
|
393
|
+
//Private--------------------------------------------------------------------
|
|
394
|
+
_cmdMove: function(){
|
|
395
|
+
//Process the move command
|
|
396
|
+
var d = new Deferred(), t = this,
|
|
397
|
+
m = t.model, i, args,
|
|
398
|
+
map = {}, moved, moves = [],
|
|
399
|
+
size = t.inner._call('size');
|
|
400
|
+
|
|
401
|
+
for(i = 0; args = arguments[i]; ++i){
|
|
402
|
+
m._msg('beforeMove', args);
|
|
403
|
+
if(args.length == 2){
|
|
404
|
+
moves = moves.concat(getMoves(args[0], args[1]));
|
|
405
|
+
}else{
|
|
406
|
+
moves.push(args);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
for(i = 0; args = moves[i]; ++i){
|
|
410
|
+
mapIndex(args[0], args[1], args[2], map);
|
|
411
|
+
}
|
|
412
|
+
for(i in map){
|
|
413
|
+
moved = 1;
|
|
414
|
+
break;
|
|
415
|
+
}
|
|
416
|
+
if(moved){
|
|
417
|
+
t.updateStore(d, moves, map);
|
|
418
|
+
}else{
|
|
419
|
+
d.callback();
|
|
420
|
+
}
|
|
421
|
+
d.then(function(){
|
|
422
|
+
m._cache.clear();
|
|
423
|
+
m._msg('moved', map);
|
|
424
|
+
m.onMoved(moves, map);
|
|
425
|
+
});
|
|
426
|
+
return d;
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
define([
|
|
2
|
+
"dojo/_base/declare",
|
|
3
|
+
/*====='../Model',=====*/
|
|
4
|
+
'../_Extension'
|
|
5
|
+
], function(declare,
|
|
6
|
+
/*=====Model, =====*/
|
|
7
|
+
_Extension){
|
|
8
|
+
|
|
9
|
+
/*=====
|
|
10
|
+
Model.query = function(){};
|
|
11
|
+
|
|
12
|
+
return declare(_Extension, {
|
|
13
|
+
// summary:
|
|
14
|
+
// Pass query to store. Using store's query system.
|
|
15
|
+
});
|
|
16
|
+
=====*/
|
|
17
|
+
|
|
18
|
+
return declare(_Extension, {
|
|
19
|
+
name: 'query',
|
|
20
|
+
|
|
21
|
+
priority: 40,
|
|
22
|
+
|
|
23
|
+
constructor: function(model, args){
|
|
24
|
+
this._mixinAPI('query');
|
|
25
|
+
this._cmdQuery(0, 0, [args.query, args.queryOptions]);
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
//Public--------------------------------------------------------------
|
|
29
|
+
query: function(/* query, queryOptions */){
|
|
30
|
+
this.model._addCmd({
|
|
31
|
+
name: '_cmdQuery',
|
|
32
|
+
scope: this,
|
|
33
|
+
args: arguments
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
//Private--------------------------------------------------------------
|
|
38
|
+
_cmdQuery: function(){
|
|
39
|
+
var a = arguments,
|
|
40
|
+
args = a[a.length - 1],
|
|
41
|
+
m = this.model,
|
|
42
|
+
c = m._cache,
|
|
43
|
+
op = c.options = c.options || {};
|
|
44
|
+
op.query = args[0];
|
|
45
|
+
op.queryOptions = args[1];
|
|
46
|
+
m._msg('storeChange');
|
|
47
|
+
c.clear();
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
define([
|
|
2
|
+
"dojo/_base/declare",
|
|
3
|
+
"dojo/_base/lang",
|
|
4
|
+
"dojo/_base/json",
|
|
5
|
+
/*====='../Model',=====*/
|
|
6
|
+
'../_Extension'
|
|
7
|
+
], function(declare, lang, json,
|
|
8
|
+
/*=====Model, =====*/
|
|
9
|
+
_Extension){
|
|
10
|
+
|
|
11
|
+
/*=====
|
|
12
|
+
Model.sort = function(){};
|
|
13
|
+
|
|
14
|
+
return declare(_Extension, {
|
|
15
|
+
// summary:
|
|
16
|
+
// Using store's sorting feature. Can define a base sort order for grid.
|
|
17
|
+
});
|
|
18
|
+
=====*/
|
|
19
|
+
|
|
20
|
+
return declare(_Extension, {
|
|
21
|
+
name: 'sort',
|
|
22
|
+
|
|
23
|
+
priority: 30,
|
|
24
|
+
|
|
25
|
+
constructor: function(model, args){
|
|
26
|
+
var t = this, bs = args.baseSort;
|
|
27
|
+
t._mixinAPI('sort');
|
|
28
|
+
if(bs && bs.length){
|
|
29
|
+
t._baseSort = bs;
|
|
30
|
+
t._sort();
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
//Public--------------------------------------------------------------
|
|
35
|
+
sort: function(/* sortSpec */){
|
|
36
|
+
this.model._addCmd({
|
|
37
|
+
name: '_cmdSort',
|
|
38
|
+
scope: this,
|
|
39
|
+
args: arguments
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
//Private--------------------------------------------------------------
|
|
44
|
+
_cmdSort: function(){
|
|
45
|
+
var a = arguments;
|
|
46
|
+
this._sort.apply(this, a[a.length - 1]);
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
_sort: function(sortSpec){
|
|
50
|
+
var t = this, m = t.model, bs = t._baseSort, c = m._cache,
|
|
51
|
+
op = c.options = c.options || {}, i, s, toSort;
|
|
52
|
+
if(lang.isArrayLike(sortSpec)){
|
|
53
|
+
for(i = 0; i < sortSpec.length; ++i){
|
|
54
|
+
s = sortSpec[i];
|
|
55
|
+
if(s.colId){
|
|
56
|
+
s.attribute = c.columns ? (c.columns[s.colId].field || s.colId) : s.colId;
|
|
57
|
+
}else{
|
|
58
|
+
s.colId = s.attribute;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if(bs){
|
|
62
|
+
sortSpec = sortSpec.concat(bs);
|
|
63
|
+
}
|
|
64
|
+
}else{
|
|
65
|
+
sortSpec = bs;
|
|
66
|
+
}
|
|
67
|
+
if(op.sort && op.sort.length){
|
|
68
|
+
if(json.toJson(op.sort) !== json.toJson(sortSpec)){
|
|
69
|
+
toSort = 1; //1 as true
|
|
70
|
+
}
|
|
71
|
+
}else if(sortSpec && sortSpec.length){
|
|
72
|
+
toSort = 1;
|
|
73
|
+
}
|
|
74
|
+
op.sort = lang.clone(sortSpec);
|
|
75
|
+
if(toSort){
|
|
76
|
+
c.clear();
|
|
77
|
+
}
|
|
78
|
+
m._msg('storeChange');
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
define({
|
|
2
|
+
biSearch: function(arr, comp){
|
|
3
|
+
var i = 0, j = arr.length, k;
|
|
4
|
+
for(k = Math.floor((i + j) / 2); i + 1 < j; k = Math.floor((i + j) / 2)){
|
|
5
|
+
if(comp(arr[k]) > 0){
|
|
6
|
+
j = k;
|
|
7
|
+
}else{
|
|
8
|
+
i = k;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return arr.length && comp(arr[i]) >= 0 ? i : j;
|
|
12
|
+
}
|
|
13
|
+
});
|