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,386 @@
|
|
|
1
|
+
define([
|
|
2
|
+
'dojo/_base/declare',
|
|
3
|
+
'dojo/_base/array',
|
|
4
|
+
'dojo/_base/lang',
|
|
5
|
+
'dojo/_base/Deferred',
|
|
6
|
+
'../_Extension'
|
|
7
|
+
], function(declare, array, lang, Deferred, _Extension){
|
|
8
|
+
|
|
9
|
+
/*=====
|
|
10
|
+
return declare(_Extension, function(){
|
|
11
|
+
// summary:
|
|
12
|
+
// Abstract base cache class, providing cache data structure and some common cache functions.
|
|
13
|
+
});
|
|
14
|
+
=====*/
|
|
15
|
+
|
|
16
|
+
var hitch = lang.hitch,
|
|
17
|
+
mixin = lang.mixin,
|
|
18
|
+
indexOf = array.indexOf;
|
|
19
|
+
|
|
20
|
+
return declare(_Extension, {
|
|
21
|
+
constructor: function(model, args){
|
|
22
|
+
var t = this;
|
|
23
|
+
t.setStore(args.store);
|
|
24
|
+
t.columns = lang.mixin({}, args._columnsById);
|
|
25
|
+
t._mixinAPI('byIndex', 'byId', 'indexToId', 'idToIndex', 'size', 'treePath', 'rootId', 'parentId',
|
|
26
|
+
'hasChildren', 'children', 'keep', 'free');
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
destroy: function(){
|
|
30
|
+
this.inherited(arguments);
|
|
31
|
+
this.clear();
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
setStore: function(store){
|
|
35
|
+
var t = this,
|
|
36
|
+
c = 'aspect',
|
|
37
|
+
old = store.fetch;
|
|
38
|
+
//Disconnect store events.
|
|
39
|
+
t.destroy();
|
|
40
|
+
t._cnnts = [];
|
|
41
|
+
t.store = store;
|
|
42
|
+
if(!old && store.notify){
|
|
43
|
+
//The store implements the dojo.store.Observable API
|
|
44
|
+
t[c](store, 'notify', function(item, id){
|
|
45
|
+
if(item === undefined){
|
|
46
|
+
t._onDelete(id);
|
|
47
|
+
}else if(id === undefined){
|
|
48
|
+
t._onNew(item);
|
|
49
|
+
}else{
|
|
50
|
+
t._onSet(item);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}else{
|
|
54
|
+
t[c](store, old ? "onSet" : "put", "_onSet");
|
|
55
|
+
t[c](store, old ? "onNew" : "add", "_onNew");
|
|
56
|
+
t[c](store, old ? "onDelete" : "remove", "_onDelete");
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
//Public----------------------------------------------
|
|
61
|
+
clear: function(){
|
|
62
|
+
var t = this;
|
|
63
|
+
t._filled = 0;
|
|
64
|
+
t._priority = [];
|
|
65
|
+
t._struct = {};
|
|
66
|
+
t._cache = {};
|
|
67
|
+
t._size = {};
|
|
68
|
+
//virtual root node, with id ''.
|
|
69
|
+
t._struct[''] = [];
|
|
70
|
+
t._size[''] = -1;
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
byIndex: function(index, parentId){
|
|
74
|
+
this._init('byIndex', arguments);
|
|
75
|
+
return this._cache[this.indexToId(index, parentId)];
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
byId: function(id){
|
|
79
|
+
this._init('byId', arguments);
|
|
80
|
+
return this._cache[id];
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
indexToId: function(index, parentId){
|
|
84
|
+
this._init('indexToId', arguments);
|
|
85
|
+
var items = this._struct[this.model.isId(parentId) ? parentId : ''];
|
|
86
|
+
return typeof index == 'number' && index >= 0 ? items && items[index + 1] : undefined;
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
idToIndex: function(id){
|
|
90
|
+
this._init('idToIndex', arguments);
|
|
91
|
+
var s = this._struct,
|
|
92
|
+
pid = s[id] && s[id][0],
|
|
93
|
+
index = indexOf(s[pid] || [], id);
|
|
94
|
+
return index > 0 ? index - 1 : -1;
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
treePath: function(id){
|
|
98
|
+
this._init('treePath', arguments);
|
|
99
|
+
var s = this._struct,
|
|
100
|
+
path = [];
|
|
101
|
+
while(id !== undefined){
|
|
102
|
+
path.unshift(id);
|
|
103
|
+
id = s[id] && s[id][0];
|
|
104
|
+
}
|
|
105
|
+
if(path[0] !== ''){
|
|
106
|
+
path = [];
|
|
107
|
+
}else{
|
|
108
|
+
path.pop();
|
|
109
|
+
}
|
|
110
|
+
return path;
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
rootId: function(id){
|
|
114
|
+
var path = this.treePath(id);
|
|
115
|
+
if(path.length > 1){
|
|
116
|
+
return path[1];
|
|
117
|
+
}else if(!path.length){
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
return id;
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
parentId: function(id){
|
|
124
|
+
return this.treePath(id).pop();
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
hasChildren: function(id){
|
|
128
|
+
var t = this,
|
|
129
|
+
s = t.store,
|
|
130
|
+
c;
|
|
131
|
+
t._init('hasChildren', arguments);
|
|
132
|
+
c = t.byId(id);
|
|
133
|
+
return s.hasChildren && s.hasChildren(id, c && c.item) && s.getChildren;
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
children: function(parentId){
|
|
137
|
+
this._init('children', arguments);
|
|
138
|
+
parentId = this.model.isId(parentId) ? parentId : '';
|
|
139
|
+
var size = this._size[parentId],
|
|
140
|
+
children = [],
|
|
141
|
+
i = 0;
|
|
142
|
+
for(; i < size; ++i){
|
|
143
|
+
children.push(this.indexToId(i, parentId));
|
|
144
|
+
}
|
|
145
|
+
return children;
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
size: function(parentId){
|
|
149
|
+
this._init('size', arguments);
|
|
150
|
+
var s = this._size[this.model.isId(parentId) ? parentId : ''];
|
|
151
|
+
return s >= 0 ? s : -1;
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
//Events--------------------------------------------
|
|
155
|
+
onBeforeFetch: function(){},
|
|
156
|
+
onAfterFetch: function(){},
|
|
157
|
+
onLoadRow: function(){},
|
|
158
|
+
|
|
159
|
+
onSetColumns: function(columns){
|
|
160
|
+
var t = this, id, c, colId, col;
|
|
161
|
+
t.columns = lang.mixin({}, columns);
|
|
162
|
+
for(id in t._cache){
|
|
163
|
+
c = t._cache[id];
|
|
164
|
+
for(colId in columns){
|
|
165
|
+
col = columns[colId];
|
|
166
|
+
c.data[colId] = t._formatCell(col.id, c.rawData);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
|
|
171
|
+
//Protected-----------------------------------------
|
|
172
|
+
_itemToObject: function(item){
|
|
173
|
+
var s = this.store,
|
|
174
|
+
obj = {};
|
|
175
|
+
if(s.fetch){
|
|
176
|
+
array.forEach(s.getAttributes(item), function(attr){
|
|
177
|
+
obj[attr] = s.getValue(item, attr);
|
|
178
|
+
});
|
|
179
|
+
return obj;
|
|
180
|
+
}
|
|
181
|
+
return item;
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
_formatCell: function(colId, rawData){
|
|
185
|
+
var col = this.columns[colId];
|
|
186
|
+
return col.formatter ? col.formatter(rawData) : rawData[col.field || colId];
|
|
187
|
+
},
|
|
188
|
+
|
|
189
|
+
_formatRow: function(rowData){
|
|
190
|
+
var cols = this.columns, res = {}, colId;
|
|
191
|
+
for(colId in cols){
|
|
192
|
+
res[colId] = this._formatCell(colId, rowData);
|
|
193
|
+
}
|
|
194
|
+
return res;
|
|
195
|
+
},
|
|
196
|
+
|
|
197
|
+
_addRow: function(id, index, rowData, item, parentId){
|
|
198
|
+
var t = this,
|
|
199
|
+
st = t._struct,
|
|
200
|
+
pr = t._priority,
|
|
201
|
+
pid = t.model.isId(parentId) ? parentId : '',
|
|
202
|
+
ids = st[pid],
|
|
203
|
+
i;
|
|
204
|
+
if(!ids){
|
|
205
|
+
throw new Error("Fatal error of _Cache._addRow: parent item " + pid + " of " + id + " is not loaded");
|
|
206
|
+
}
|
|
207
|
+
var oldId = ids[index + 1];
|
|
208
|
+
if(t.model.isId(oldId) && oldId !== id){
|
|
209
|
+
console.error("Error of _Cache._addRow: different row id " + id + " and " + ids[index + 1] + " for same row index " + index);
|
|
210
|
+
}
|
|
211
|
+
ids[index + 1] = id;
|
|
212
|
+
st[id] = st[id] || [pid];
|
|
213
|
+
if(pid === ''){
|
|
214
|
+
i = indexOf(pr, id);
|
|
215
|
+
if(i >= 0){
|
|
216
|
+
pr.splice(i, 1);
|
|
217
|
+
}
|
|
218
|
+
pr.push(id);
|
|
219
|
+
}
|
|
220
|
+
t._cache[id] = {
|
|
221
|
+
data: t._formatRow(rowData),
|
|
222
|
+
rawData: rowData,
|
|
223
|
+
item: item
|
|
224
|
+
};
|
|
225
|
+
t.onLoadRow(id);
|
|
226
|
+
},
|
|
227
|
+
|
|
228
|
+
_storeFetch: function(options, onFetched){
|
|
229
|
+
// console.debug("\tFETCH parent: ",
|
|
230
|
+
// options.parentId, ", start: ",
|
|
231
|
+
// options.start || 0, ", count: ",
|
|
232
|
+
// options.count, ", end: ",
|
|
233
|
+
// options.count && (options.start || 0) + options.count - 1, ", options:",
|
|
234
|
+
// this.options);
|
|
235
|
+
|
|
236
|
+
var t = this,
|
|
237
|
+
s = t.store,
|
|
238
|
+
d = new Deferred(),
|
|
239
|
+
parentId = t.model.isId(options.parentId) ? options.parentId : '',
|
|
240
|
+
req = mixin({}, t.options || {}, options),
|
|
241
|
+
onError = hitch(d, d.errback),
|
|
242
|
+
results;
|
|
243
|
+
function onBegin(size){
|
|
244
|
+
t._size[parentId] = parseInt(size, 10);
|
|
245
|
+
}
|
|
246
|
+
function onComplete(items){
|
|
247
|
+
try{
|
|
248
|
+
var start = options.start || 0,
|
|
249
|
+
i = 0,
|
|
250
|
+
item;
|
|
251
|
+
for(; item = items[i]; ++i){
|
|
252
|
+
t._addRow(s.getIdentity(item), start + i, t._itemToObject(item), item, parentId);
|
|
253
|
+
}
|
|
254
|
+
d.callback();
|
|
255
|
+
}catch(e){
|
|
256
|
+
d.errback(e);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
t._filled = 1;
|
|
260
|
+
t.onBeforeFetch(req);
|
|
261
|
+
if(parentId === ''){
|
|
262
|
+
if(s.fetch){
|
|
263
|
+
s.fetch(mixin(req, {
|
|
264
|
+
onBegin: onBegin,
|
|
265
|
+
onComplete: onComplete,
|
|
266
|
+
onError: onError
|
|
267
|
+
}));
|
|
268
|
+
}else{
|
|
269
|
+
results = s.query(req.query || {}, req);
|
|
270
|
+
Deferred.when(results.total, onBegin);
|
|
271
|
+
Deferred.when(results, onComplete, onError);
|
|
272
|
+
}
|
|
273
|
+
}else if(t.hasChildren(parentId)){
|
|
274
|
+
results = s.getChildren(t.byId(parentId).item, req);
|
|
275
|
+
if('total' in results){
|
|
276
|
+
Deferred.when(results.total, onBegin);
|
|
277
|
+
}else{
|
|
278
|
+
Deferred.when(results, function(results){
|
|
279
|
+
onBegin(results.length);
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
Deferred.when(results, onComplete, onError);
|
|
283
|
+
}else{
|
|
284
|
+
d.callback();
|
|
285
|
+
}
|
|
286
|
+
d.then(function(){
|
|
287
|
+
t.onAfterFetch();
|
|
288
|
+
});
|
|
289
|
+
return d;
|
|
290
|
+
},
|
|
291
|
+
|
|
292
|
+
//--------------------------------------------------------------------------
|
|
293
|
+
_onSet: function(item){
|
|
294
|
+
var t = this,
|
|
295
|
+
id = t.store.getIdentity(item),
|
|
296
|
+
index = t.idToIndex(id),
|
|
297
|
+
path = t.treePath(id),
|
|
298
|
+
old = t._cache[id];
|
|
299
|
+
if(path.length){
|
|
300
|
+
t._addRow(id, index, t._itemToObject(item), item, path.pop());
|
|
301
|
+
}
|
|
302
|
+
t.onSet(id, index, t._cache[id], old);
|
|
303
|
+
},
|
|
304
|
+
|
|
305
|
+
_onNew: function(item, parentInfo){
|
|
306
|
+
var t = this,
|
|
307
|
+
s = t.store,
|
|
308
|
+
row = t._itemToObject(item),
|
|
309
|
+
parentItem = parentInfo && parentInfo[s.fetch ? 'item' : 'parent'],
|
|
310
|
+
parentId = parentItem ? s.getIdentity(parentItem) : '',
|
|
311
|
+
size = t._size[''];
|
|
312
|
+
t.clear();
|
|
313
|
+
t.onNew(s.getIdentity(item), 0, {
|
|
314
|
+
data: t._formatRow(row),
|
|
315
|
+
rawData: row,
|
|
316
|
+
item: item
|
|
317
|
+
});
|
|
318
|
+
if(!parentItem && size >= 0){
|
|
319
|
+
t._size[''] = size + 1;
|
|
320
|
+
t.model._onSizeChange();
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
|
|
324
|
+
_onDelete: function(item){
|
|
325
|
+
var t = this,
|
|
326
|
+
s = t.store,
|
|
327
|
+
st = t._struct,
|
|
328
|
+
id = s.fetch ? s.getIdentity(item) : item,
|
|
329
|
+
path = t.treePath(id);
|
|
330
|
+
if(path.length){
|
|
331
|
+
var children, i, j,
|
|
332
|
+
ids = [id],
|
|
333
|
+
parentId = path[path.length - 1],
|
|
334
|
+
sz = t._size,
|
|
335
|
+
size = sz[''],
|
|
336
|
+
index = indexOf(st[parentId], id);
|
|
337
|
+
//This must exist, because we've already have treePath
|
|
338
|
+
st[parentId].splice(index, 1);
|
|
339
|
+
--sz[parentId];
|
|
340
|
+
|
|
341
|
+
for(i = 0; i < ids.length; ++i){
|
|
342
|
+
children = st[ids[i]];
|
|
343
|
+
if(children){
|
|
344
|
+
for(j = children.length - 1; j > 0; --j){
|
|
345
|
+
ids.push(children[j]);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
for(i = ids.length - 1; i >= 0; --i){
|
|
350
|
+
j = ids[i];
|
|
351
|
+
delete t._cache[j];
|
|
352
|
+
delete st[j];
|
|
353
|
+
delete sz[j];
|
|
354
|
+
}
|
|
355
|
+
i = indexOf(t._priority, id);
|
|
356
|
+
if(i >= 0){
|
|
357
|
+
t._priority.splice(i, 1);
|
|
358
|
+
}
|
|
359
|
+
t.onDelete(id, index - 1, path);
|
|
360
|
+
if(!parentId && size >= 0){
|
|
361
|
+
sz[''] = size - 1;
|
|
362
|
+
t.model._onSizeChange();
|
|
363
|
+
}
|
|
364
|
+
}else{
|
|
365
|
+
//FIXME: Don't know what to do if the deleted row was not loaded.
|
|
366
|
+
t.clear();
|
|
367
|
+
t.onDelete(id);
|
|
368
|
+
// var onBegin = hitch(t, _onBegin),
|
|
369
|
+
// req = mixin({}, t.options || {}, {
|
|
370
|
+
// start: 0,
|
|
371
|
+
// count: 1
|
|
372
|
+
// });
|
|
373
|
+
// setTimeout(function(){
|
|
374
|
+
// if(s.fetch){
|
|
375
|
+
// s.fetch(mixin(req, {
|
|
376
|
+
// onBegin: onBegin
|
|
377
|
+
// }));
|
|
378
|
+
// }else{
|
|
379
|
+
// var results = s.query(req.query, req);
|
|
380
|
+
// Deferred.when(results.total, onBegin);
|
|
381
|
+
// }
|
|
382
|
+
// }, 10);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
});
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
define([
|
|
2
|
+
"dojo/_base/declare",
|
|
3
|
+
"dojo/_base/array",
|
|
4
|
+
"dojo/_base/lang",
|
|
5
|
+
"dojo/_base/Deferred",
|
|
6
|
+
/*====='../Model',=====*/
|
|
7
|
+
'../_Extension'
|
|
8
|
+
], function(declare, array, lang, Deferred,
|
|
9
|
+
/*=====Model, =====*/
|
|
10
|
+
_Extension){
|
|
11
|
+
|
|
12
|
+
/*=====
|
|
13
|
+
Model.filter = function(){};
|
|
14
|
+
Model.hasFilter = function(){};
|
|
15
|
+
Model.onFilterProgress = function(){};
|
|
16
|
+
|
|
17
|
+
return declare(_Extension, {
|
|
18
|
+
// summary:
|
|
19
|
+
// Filtering grid data at client side.
|
|
20
|
+
});
|
|
21
|
+
=====*/
|
|
22
|
+
|
|
23
|
+
var hitch = lang.hitch,
|
|
24
|
+
forEach = array.forEach,
|
|
25
|
+
indexOf = array.indexOf;
|
|
26
|
+
|
|
27
|
+
return declare(_Extension, {
|
|
28
|
+
// Not compatible with Map extension!
|
|
29
|
+
name: 'clientFilter',
|
|
30
|
+
|
|
31
|
+
priority: 20,
|
|
32
|
+
|
|
33
|
+
constructor: function(model, args){
|
|
34
|
+
this.pageSize = args.pageSize || 100;
|
|
35
|
+
this._mixinAPI('filter', 'hasFilter');
|
|
36
|
+
model.onFilterProgress = function(){};
|
|
37
|
+
this.aspect(model, '_msg', '_receiveMsg');
|
|
38
|
+
this.aspect(model, 'setStore', 'clear');
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
//Public---------------------------------------------------------------------
|
|
42
|
+
|
|
43
|
+
//pageSize: 100,
|
|
44
|
+
|
|
45
|
+
clear: function(){
|
|
46
|
+
this._ids = 0;
|
|
47
|
+
this._indexes = {};
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
filter: function(checker){
|
|
51
|
+
this.model._addCmd({
|
|
52
|
+
name: '_cmdFilter',
|
|
53
|
+
scope: this,
|
|
54
|
+
args: arguments,
|
|
55
|
+
async: 1
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
hasFilter: function(){
|
|
60
|
+
return !!this._ids;
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
byIndex: function(index, parentId){
|
|
64
|
+
var t = this,
|
|
65
|
+
ids = t._ids,
|
|
66
|
+
inner = t.inner,
|
|
67
|
+
id = ids && ids[index];
|
|
68
|
+
return !t.model.isId(parentId) && ids ? t.model.isId(id) && inner._call('byId', [id]) : inner._call('byIndex', arguments);
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
byId: function(id){
|
|
72
|
+
return (this.ids && this._indexes[id] === undefined) ? null : this.inner._call('byId', arguments);
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
indexToId: function(index, parentId){
|
|
76
|
+
return !this.model.isId(parentId) && this._ids ? this._ids[index] : this.inner._call('indexToId', arguments);
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
idToIndex: function(id){
|
|
80
|
+
if(this._ids && this.inner._call('parentId', arguments) === ''){
|
|
81
|
+
var idx = indexOf(this._ids, id);
|
|
82
|
+
return idx >= 0 ? idx : undefined;
|
|
83
|
+
}
|
|
84
|
+
return this.inner._call('idToIndex', arguments);
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
size: function(parentId){
|
|
88
|
+
return !this.model.isId(parentId) && this._ids ? this._ids.length : this.inner._call('size', arguments);
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
when: function(args, callback){
|
|
92
|
+
var t = this,
|
|
93
|
+
f = function(){
|
|
94
|
+
if(t._ids){
|
|
95
|
+
t._mapWhenArgs(args);
|
|
96
|
+
}
|
|
97
|
+
return t.inner._call('when', [args, callback]);
|
|
98
|
+
};
|
|
99
|
+
if(t._refilter){
|
|
100
|
+
t._refilter = 0;
|
|
101
|
+
if(t._ids){
|
|
102
|
+
var d = new Deferred();
|
|
103
|
+
t._reFilter().then(function(){
|
|
104
|
+
f().then(hitch(d, d.callback), hitch(d, d.errback));
|
|
105
|
+
});
|
|
106
|
+
return d;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return f();
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
//Private---------------------------------------------------------------------
|
|
113
|
+
_cmdFilter: function(){
|
|
114
|
+
var a = arguments;
|
|
115
|
+
return this._filter.apply(this, a[a.length - 1]);
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
_filter: function(checker){
|
|
119
|
+
var t = this,
|
|
120
|
+
oldSize = t.size();
|
|
121
|
+
t.clear();
|
|
122
|
+
if(lang.isFunction(checker)){
|
|
123
|
+
var ids = [];
|
|
124
|
+
return t.model.scan({
|
|
125
|
+
start: 0,
|
|
126
|
+
pageSize: t.pageSize,
|
|
127
|
+
whenScope: t,
|
|
128
|
+
whenFunc: t.when
|
|
129
|
+
}, function(rows, s){
|
|
130
|
+
var i, id, row,
|
|
131
|
+
end = s + rows.length;
|
|
132
|
+
for(i = s; i < end; ++i){
|
|
133
|
+
id = t.indexToId(i);
|
|
134
|
+
row = t.byIndex(i);
|
|
135
|
+
if(row){
|
|
136
|
+
if(checker(row, id)){
|
|
137
|
+
ids.push(id);
|
|
138
|
+
t._indexes[id] = i;
|
|
139
|
+
}
|
|
140
|
+
}else{
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}).then(function(){
|
|
145
|
+
if(ids.length == t.size()){
|
|
146
|
+
//Filtered item size equals cache size, so filter is useless.
|
|
147
|
+
t.clear();
|
|
148
|
+
}else{
|
|
149
|
+
t._ids = ids;
|
|
150
|
+
t.model._msg('filter', ids);
|
|
151
|
+
}
|
|
152
|
+
}, 0, t.model.onFilterProgress);
|
|
153
|
+
}else{
|
|
154
|
+
var d = new Deferred();
|
|
155
|
+
d.callback();
|
|
156
|
+
return d;
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
|
|
160
|
+
_mapWhenArgs: function(args){
|
|
161
|
+
//Map ids and index ranges to what the store needs.
|
|
162
|
+
var t = this, ranges = [], size = t._ids.length;
|
|
163
|
+
args.id = array.filter(args.id, function(id){
|
|
164
|
+
return t._indexes[id] !== undefined;
|
|
165
|
+
});
|
|
166
|
+
forEach(args.range, function(r){
|
|
167
|
+
if(t.model.isId(r.parentId)){
|
|
168
|
+
ranges.push(r);
|
|
169
|
+
}else{
|
|
170
|
+
if(!r.count || r.count < 0){
|
|
171
|
+
//For open ranges, must limit the size because we know the filtered size here.
|
|
172
|
+
var cnt = size - r.start;
|
|
173
|
+
if(cnt <= 0){
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
r.count = cnt;
|
|
177
|
+
}
|
|
178
|
+
for(var i = 0; i < r.count; ++i){
|
|
179
|
+
var idx = t._mapIndex(i + r.start);
|
|
180
|
+
if(idx !== undefined){
|
|
181
|
+
ranges.push({
|
|
182
|
+
start: idx,
|
|
183
|
+
count: 1
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
args.range = ranges;
|
|
190
|
+
},
|
|
191
|
+
|
|
192
|
+
_mapMoveArgs: function(args){
|
|
193
|
+
var t = this;
|
|
194
|
+
if(args.length == 3){
|
|
195
|
+
var indexes = [];
|
|
196
|
+
for(var i = args[0], end = args[0] + args[1]; i < end; ++i){
|
|
197
|
+
indexes.push(t._mapIndex(i));
|
|
198
|
+
}
|
|
199
|
+
args[0] = indexes;
|
|
200
|
+
args[1] = t._mapIndex(args[2]);
|
|
201
|
+
args.pop();
|
|
202
|
+
}else{
|
|
203
|
+
args[0] = array.map(args[0], function(index){
|
|
204
|
+
return t._mapIndex(index);
|
|
205
|
+
});
|
|
206
|
+
args[1] = t._mapIndex(args[1]);
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
|
|
210
|
+
_mapIndex: function(index){
|
|
211
|
+
return this._indexes[this._ids[index]];
|
|
212
|
+
},
|
|
213
|
+
|
|
214
|
+
_moveFiltered: function(start, count, target){
|
|
215
|
+
var t = this, size = t._ids.length;
|
|
216
|
+
if(start >= 0 && start < size &&
|
|
217
|
+
count > 0 && count < Infinity &&
|
|
218
|
+
target >= 0 && target < size &&
|
|
219
|
+
(target < start || target > start + count)){
|
|
220
|
+
|
|
221
|
+
var i, len, indexes = [];
|
|
222
|
+
for(i = start, len = start + count; i < len; ++i){
|
|
223
|
+
indexes.push(t._mapIndex(i));
|
|
224
|
+
}
|
|
225
|
+
t.inner._call('moveIndexes', [indexes, t._mapIndex(target)]);
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
|
|
229
|
+
_reFilter: function(){
|
|
230
|
+
var t = this;
|
|
231
|
+
return t.inner._call('when', [{
|
|
232
|
+
id: t._ids,
|
|
233
|
+
range: []
|
|
234
|
+
}, function(){
|
|
235
|
+
forEach(t._ids, function(id){
|
|
236
|
+
var idx = t.inner._call('idToIndex', [id]);
|
|
237
|
+
t._indexes[id] = idx;
|
|
238
|
+
});
|
|
239
|
+
t._ids.sort(function(a, b){
|
|
240
|
+
return t._indexes[a] - t._indexes[b];
|
|
241
|
+
});
|
|
242
|
+
}]);
|
|
243
|
+
},
|
|
244
|
+
|
|
245
|
+
_onMoved: function(map){
|
|
246
|
+
var t = this;
|
|
247
|
+
forEach(t._ids, function(id){
|
|
248
|
+
var oldIdx = t._indexes[id];
|
|
249
|
+
if(map[oldIdx] !== undefined){
|
|
250
|
+
t._indexes[id] = map[oldIdx];
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
t._ids.sort(function(a, b){
|
|
254
|
+
return t._indexes[a] - t._indexes[b];
|
|
255
|
+
});
|
|
256
|
+
},
|
|
257
|
+
|
|
258
|
+
_receiveMsg: function(msg, args){
|
|
259
|
+
var t = this;
|
|
260
|
+
if(t._ids){
|
|
261
|
+
if(msg == 'storeChange'){
|
|
262
|
+
t._refilter = 1;
|
|
263
|
+
}else if(msg == 'moved'){
|
|
264
|
+
t._onMoved(args);
|
|
265
|
+
}else if(msg == 'beforeMove'){
|
|
266
|
+
t._mapMoveArgs(args);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
|
|
271
|
+
_onNew: function(id){
|
|
272
|
+
var t = this;
|
|
273
|
+
if(t._ids){
|
|
274
|
+
t._ids.push(id);
|
|
275
|
+
t._refilter = 1;
|
|
276
|
+
}
|
|
277
|
+
t.onNew.apply(t, arguments);
|
|
278
|
+
},
|
|
279
|
+
|
|
280
|
+
_onDelete: function(id, index, row){
|
|
281
|
+
var t = this, indexes = t._indexes, ids = t._ids;
|
|
282
|
+
if(ids){
|
|
283
|
+
var i = indexOf(ids, id),
|
|
284
|
+
idx = indexes[id];
|
|
285
|
+
if(i >= 0){
|
|
286
|
+
ids.splice(i, 1);
|
|
287
|
+
}
|
|
288
|
+
if(i >= 0 && idx !== undefined){
|
|
289
|
+
index = i;
|
|
290
|
+
for(i in indexes){
|
|
291
|
+
if(indexes[i] > idx){
|
|
292
|
+
--indexes[i];
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}else{
|
|
296
|
+
index = undefined;
|
|
297
|
+
t._refilter = 1;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
t.onDelete(id, index, row);
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
});
|