gridx-rails 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/LICENSE +2 -0
- data/README.md +18 -0
- data/Rakefile +36 -0
- data/app/assets/images/gridx/mobile/themes/iphone/images/ajax-loader.gif +0 -0
- data/app/assets/images/gridx/mobile/themes/iphone/images/arrow.png +0 -0
- data/app/assets/images/gridx/resources/images/checkboxpartial.png +0 -0
- data/app/assets/images/gridx/resources/images/checkboxpartialdisabled.png +0 -0
- data/app/assets/images/gridx/resources/images/claro-grid-header-onepixel.bmp +0 -0
- data/app/assets/images/gridx/resources/images/dndCopy.png +0 -0
- data/app/assets/images/gridx/resources/images/dndMove.png +0 -0
- data/app/assets/images/gridx/resources/images/dndNoCopy.png +0 -0
- data/app/assets/images/gridx/resources/images/dndNoMove.png +0 -0
- data/app/assets/images/gridx/resources/images/gridxCellChanged.png +0 -0
- data/app/assets/images/gridx/resources/images/header.png +0 -0
- data/app/assets/images/gridx/resources/images/header_shadow.png +0 -0
- data/app/assets/images/gridx/resources/images/loadingAnimation.gif +0 -0
- data/app/assets/images/gridx/resources/images/row_back.png +0 -0
- data/app/assets/images/gridx/resources/images/row_back_changed.png +0 -0
- data/app/assets/images/gridx/resources/images/sprite_icons.png +0 -0
- data/app/assets/images/gridx/resources/images/treeExpandImages.png +0 -0
- data/app/assets/images/gridx/resources/images/treeExpand_loading.gif +0 -0
- data/app/assets/javascripts/gridx/Grid.js +224 -0
- data/app/assets/javascripts/gridx/GridCommon.js +52 -0
- data/app/assets/javascripts/gridx/allModules.js +105 -0
- data/app/assets/javascripts/gridx/core/Cell.js +86 -0
- data/app/assets/javascripts/gridx/core/Column.js +183 -0
- data/app/assets/javascripts/gridx/core/Core.js +447 -0
- data/app/assets/javascripts/gridx/core/Row.js +174 -0
- data/app/assets/javascripts/gridx/core/_Module.js +285 -0
- data/app/assets/javascripts/gridx/core/model/Model.js +495 -0
- data/app/assets/javascripts/gridx/core/model/_Extension.js +84 -0
- data/app/assets/javascripts/gridx/core/model/cache/Async.js +469 -0
- data/app/assets/javascripts/gridx/core/model/cache/Sync.js +59 -0
- data/app/assets/javascripts/gridx/core/model/cache/_Cache.js +386 -0
- data/app/assets/javascripts/gridx/core/model/extensions/ClientFilter.js +303 -0
- data/app/assets/javascripts/gridx/core/model/extensions/FormatSort.js +103 -0
- data/app/assets/javascripts/gridx/core/model/extensions/Mark.js +370 -0
- data/app/assets/javascripts/gridx/core/model/extensions/Modify.js +418 -0
- data/app/assets/javascripts/gridx/core/model/extensions/Move.js +429 -0
- data/app/assets/javascripts/gridx/core/model/extensions/Query.js +50 -0
- data/app/assets/javascripts/gridx/core/model/extensions/Sort.js +81 -0
- data/app/assets/javascripts/gridx/core/util.js +13 -0
- data/app/assets/javascripts/gridx/mobile/Grid.js +300 -0
- data/app/assets/javascripts/gridx/mobile/LazyLoad.js +88 -0
- data/app/assets/javascripts/gridx/mobile/PullRefresh.js +117 -0
- data/app/assets/javascripts/gridx/mobile/Sort.js +66 -0
- data/app/assets/javascripts/gridx/mobile/nls/LazyLoad.js +38 -0
- data/app/assets/javascripts/gridx/mobile/nls/PullRefresh.js +39 -0
- data/app/assets/javascripts/gridx/mobile/nls/ar/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/ar/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/ar/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/bg/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/bg/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/bg/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/ca/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/ca/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/ca/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/common.js +37 -0
- data/app/assets/javascripts/gridx/mobile/nls/cs/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/cs/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/cs/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/da/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/da/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/da/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/de/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/de/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/de/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/el/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/el/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/el/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/es/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/es/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/es/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/fi/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/fi/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/fi/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/fr/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/fr/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/fr/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/he/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/he/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/he/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/hr/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/hr/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/hr/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/hu/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/hu/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/hu/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/it/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/it/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/it/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/ja/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/ja/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/ja/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/kk/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/kk/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/kk/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/ko/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/ko/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/ko/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/nb/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/nb/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/nb/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/nl/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/nl/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/nl/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/pl/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/pl/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/pl/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/pt/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/pt/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/pt/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/pt-pt/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/pt-pt/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/pt-pt/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/ro/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/ro/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/ro/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/ru/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/ru/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/ru/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/sk/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/sk/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/sk/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/sl/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/sl/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/sl/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/sv/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/sv/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/sv/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/th/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/th/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/th/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/tr/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/tr/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/tr/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/uk/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/uk/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/uk/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/zh/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/zh/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/zh/common.js +5 -0
- data/app/assets/javascripts/gridx/mobile/nls/zh-tw/LazyLoad.js +6 -0
- data/app/assets/javascripts/gridx/mobile/nls/zh-tw/PullRefresh.js +7 -0
- data/app/assets/javascripts/gridx/mobile/nls/zh-tw/common.js +5 -0
- data/app/assets/javascripts/gridx/modules/AutoScroll.js +100 -0
- data/app/assets/javascripts/gridx/modules/Bar.js +322 -0
- data/app/assets/javascripts/gridx/modules/Body.js +1059 -0
- data/app/assets/javascripts/gridx/modules/CellWidget.js +538 -0
- data/app/assets/javascripts/gridx/modules/ColumnLock.js +254 -0
- data/app/assets/javascripts/gridx/modules/ColumnResizer.js +278 -0
- data/app/assets/javascripts/gridx/modules/ColumnWidth.js +320 -0
- data/app/assets/javascripts/gridx/modules/Dod.js +368 -0
- data/app/assets/javascripts/gridx/modules/Edit.js +1024 -0
- data/app/assets/javascripts/gridx/modules/Filter.js +482 -0
- data/app/assets/javascripts/gridx/modules/Focus.js +439 -0
- data/app/assets/javascripts/gridx/modules/GroupHeader.js +437 -0
- data/app/assets/javascripts/gridx/modules/HLayout.js +139 -0
- data/app/assets/javascripts/gridx/modules/HScroller.js +172 -0
- data/app/assets/javascripts/gridx/modules/Header.js +289 -0
- data/app/assets/javascripts/gridx/modules/HeaderMenu.js +63 -0
- data/app/assets/javascripts/gridx/modules/HeaderRegions.js +201 -0
- data/app/assets/javascripts/gridx/modules/HiddenColumns.js +274 -0
- data/app/assets/javascripts/gridx/modules/IndirectSelect.js +287 -0
- data/app/assets/javascripts/gridx/modules/IndirectSelectColumn.js +277 -0
- data/app/assets/javascripts/gridx/modules/Menu.js +167 -0
- data/app/assets/javascripts/gridx/modules/NavigableCell.js +170 -0
- data/app/assets/javascripts/gridx/modules/NestedSort.js +280 -0
- data/app/assets/javascripts/gridx/modules/PagedBody.js +409 -0
- data/app/assets/javascripts/gridx/modules/Pagination.js +293 -0
- data/app/assets/javascripts/gridx/modules/Persist.js +266 -0
- data/app/assets/javascripts/gridx/modules/Printer.js +49 -0
- data/app/assets/javascripts/gridx/modules/RowHeader.js +412 -0
- data/app/assets/javascripts/gridx/modules/RowLock.js +143 -0
- data/app/assets/javascripts/gridx/modules/SingleSort.js +276 -0
- data/app/assets/javascripts/gridx/modules/SummaryBar.js +33 -0
- data/app/assets/javascripts/gridx/modules/TitleBar.js +51 -0
- data/app/assets/javascripts/gridx/modules/ToolBar.js +55 -0
- data/app/assets/javascripts/gridx/modules/TouchScroll.js +103 -0
- data/app/assets/javascripts/gridx/modules/TouchVScroller.js +89 -0
- data/app/assets/javascripts/gridx/modules/Traverse.js +159 -0
- data/app/assets/javascripts/gridx/modules/Tree.js +646 -0
- data/app/assets/javascripts/gridx/modules/VLayout.js +152 -0
- data/app/assets/javascripts/gridx/modules/VScroller.js +342 -0
- data/app/assets/javascripts/gridx/modules/View.js +540 -0
- data/app/assets/javascripts/gridx/modules/VirtualVScroller.js +445 -0
- data/app/assets/javascripts/gridx/modules/barPlugins/DropDownPager.js +16 -0
- data/app/assets/javascripts/gridx/modules/barPlugins/DropDownSizer.js +16 -0
- data/app/assets/javascripts/gridx/modules/barPlugins/GotoPageButton.js +16 -0
- data/app/assets/javascripts/gridx/modules/barPlugins/LinkPager.js +16 -0
- data/app/assets/javascripts/gridx/modules/barPlugins/LinkSizer.js +16 -0
- data/app/assets/javascripts/gridx/modules/barPlugins/Summary.js +16 -0
- data/app/assets/javascripts/gridx/modules/dnd/Avatar.js +45 -0
- data/app/assets/javascripts/gridx/modules/dnd/Column.js +210 -0
- data/app/assets/javascripts/gridx/modules/dnd/Row.js +286 -0
- data/app/assets/javascripts/gridx/modules/dnd/_Base.js +60 -0
- data/app/assets/javascripts/gridx/modules/dnd/_Dnd.js +371 -0
- data/app/assets/javascripts/gridx/modules/exporter/CSV.js +43 -0
- data/app/assets/javascripts/gridx/modules/exporter/Exporter.js +34 -0
- data/app/assets/javascripts/gridx/modules/exporter/Table.js +42 -0
- data/app/assets/javascripts/gridx/modules/extendedSelect/Cell.js +491 -0
- data/app/assets/javascripts/gridx/modules/extendedSelect/Column.js +290 -0
- data/app/assets/javascripts/gridx/modules/extendedSelect/Row.js +458 -0
- data/app/assets/javascripts/gridx/modules/extendedSelect/_Base.js +244 -0
- data/app/assets/javascripts/gridx/modules/extendedSelect/_RowCellBase.js +35 -0
- data/app/assets/javascripts/gridx/modules/filter/DistinctComboBoxMenu.js +22 -0
- data/app/assets/javascripts/gridx/modules/filter/Filter.js +16 -0
- data/app/assets/javascripts/gridx/modules/filter/FilterBar.js +649 -0
- data/app/assets/javascripts/gridx/modules/filter/FilterConfirmDialog.js +33 -0
- data/app/assets/javascripts/gridx/modules/filter/FilterDialog.js +179 -0
- data/app/assets/javascripts/gridx/modules/filter/FilterPane.js +340 -0
- data/app/assets/javascripts/gridx/modules/filter/FilterTooltip.js +103 -0
- data/app/assets/javascripts/gridx/modules/filter/QuickFilter.js +33 -0
- data/app/assets/javascripts/gridx/modules/move/Column.js +223 -0
- data/app/assets/javascripts/gridx/modules/move/Row.js +154 -0
- data/app/assets/javascripts/gridx/modules/pagination/Pagination.js +16 -0
- data/app/assets/javascripts/gridx/modules/pagination/PaginationBar.js +68 -0
- data/app/assets/javascripts/gridx/modules/pagination/PaginationBarDD.js +40 -0
- data/app/assets/javascripts/gridx/modules/pagination/_PaginationBarBase.js +105 -0
- data/app/assets/javascripts/gridx/modules/select/Cell.js +229 -0
- data/app/assets/javascripts/gridx/modules/select/Column.js +209 -0
- data/app/assets/javascripts/gridx/modules/select/Row.js +302 -0
- data/app/assets/javascripts/gridx/modules/select/_Base.js +99 -0
- data/app/assets/javascripts/gridx/modules/select/_RowCellBase.js +51 -0
- data/app/assets/javascripts/gridx/nls/Body.js +47 -0
- data/app/assets/javascripts/gridx/nls/FilterBar.js +133 -0
- data/app/assets/javascripts/gridx/nls/NestedSort.js +45 -0
- data/app/assets/javascripts/gridx/nls/PaginationBar.js +68 -0
- data/app/assets/javascripts/gridx/nls/QuickFilter.js +40 -0
- data/app/assets/javascripts/gridx/nls/SummaryBar.js +38 -0
- data/app/assets/javascripts/gridx/nls/ar/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/ar/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/ar/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/ar/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/ar/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/ar/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/bg/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/bg/FilterBar.js +88 -0
- data/app/assets/javascripts/gridx/nls/bg/NestedSort.js +12 -0
- data/app/assets/javascripts/gridx/nls/bg/PaginationBar.js +28 -0
- data/app/assets/javascripts/gridx/nls/bg/QuickFilter.js +8 -0
- data/app/assets/javascripts/gridx/nls/bg/SummaryBar.js +6 -0
- data/app/assets/javascripts/gridx/nls/ca/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/ca/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/ca/NestedSort.js +13 -0
- data/app/assets/javascripts/gridx/nls/ca/PaginationBar.js +30 -0
- data/app/assets/javascripts/gridx/nls/ca/QuickFilter.js +9 -0
- data/app/assets/javascripts/gridx/nls/ca/SummaryBar.js +7 -0
- data/app/assets/javascripts/gridx/nls/cs/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/cs/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/cs/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/cs/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/cs/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/cs/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/da/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/da/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/da/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/da/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/da/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/da/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/de/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/de/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/de/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/de/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/de/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/de/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/el/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/el/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/el/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/el/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/el/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/el/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/es/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/es/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/es/NestedSort.js +13 -0
- data/app/assets/javascripts/gridx/nls/es/PaginationBar.js +30 -0
- data/app/assets/javascripts/gridx/nls/es/QuickFilter.js +9 -0
- data/app/assets/javascripts/gridx/nls/es/SummaryBar.js +7 -0
- data/app/assets/javascripts/gridx/nls/fi/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/fi/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/fi/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/fi/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/fi/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/fi/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/fr/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/fr/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/fr/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/fr/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/fr/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/fr/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/he/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/he/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/he/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/he/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/he/QuickFilter.js +6 -0
- data/app/assets/javascripts/gridx/nls/he/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/hr/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/hr/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/hr/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/hr/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/hr/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/hr/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/hu/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/hu/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/hu/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/hu/PaginationBar.js +33 -0
- data/app/assets/javascripts/gridx/nls/hu/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/hu/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/it/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/it/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/it/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/it/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/it/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/it/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/ja/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/ja/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/ja/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/ja/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/ja/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/ja/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/kk/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/kk/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/kk/NestedSort.js +13 -0
- data/app/assets/javascripts/gridx/nls/kk/PaginationBar.js +30 -0
- data/app/assets/javascripts/gridx/nls/kk/QuickFilter.js +9 -0
- data/app/assets/javascripts/gridx/nls/kk/SummaryBar.js +7 -0
- data/app/assets/javascripts/gridx/nls/ko/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/ko/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/ko/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/ko/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/ko/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/ko/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/nb/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/nb/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/nb/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/nb/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/nb/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/nb/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/nl/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/nl/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/nl/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/nl/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/nl/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/nl/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/pl/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/pl/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/pl/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/pl/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/pl/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/pl/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/pt/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/pt/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/pt/NestedSort.js +13 -0
- data/app/assets/javascripts/gridx/nls/pt/PaginationBar.js +30 -0
- data/app/assets/javascripts/gridx/nls/pt/QuickFilter.js +9 -0
- data/app/assets/javascripts/gridx/nls/pt/SummaryBar.js +7 -0
- data/app/assets/javascripts/gridx/nls/pt-br/Body.js +6 -0
- data/app/assets/javascripts/gridx/nls/pt-br/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/pt-br/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/pt-br/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/pt-br/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/pt-br/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/pt-pt/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/pt-pt/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/pt-pt/NestedSort.js +13 -0
- data/app/assets/javascripts/gridx/nls/pt-pt/PaginationBar.js +30 -0
- data/app/assets/javascripts/gridx/nls/pt-pt/QuickFilter.js +9 -0
- data/app/assets/javascripts/gridx/nls/pt-pt/SummaryBar.js +7 -0
- data/app/assets/javascripts/gridx/nls/ro/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/ro/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/ro/NestedSort.js +13 -0
- data/app/assets/javascripts/gridx/nls/ro/PaginationBar.js +30 -0
- data/app/assets/javascripts/gridx/nls/ro/QuickFilter.js +9 -0
- data/app/assets/javascripts/gridx/nls/ro/SummaryBar.js +7 -0
- data/app/assets/javascripts/gridx/nls/ru/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/ru/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/ru/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/ru/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/ru/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/ru/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/sk/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/sk/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/sk/NestedSort.js +13 -0
- data/app/assets/javascripts/gridx/nls/sk/PaginationBar.js +30 -0
- data/app/assets/javascripts/gridx/nls/sk/QuickFilter.js +9 -0
- data/app/assets/javascripts/gridx/nls/sk/SummaryBar.js +7 -0
- data/app/assets/javascripts/gridx/nls/sl/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/sl/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/sl/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/sl/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/sl/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/sl/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/sv/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/sv/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/sv/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/sv/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/sv/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/sv/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/th/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/th/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/th/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/th/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/th/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/th/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/tr/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/tr/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/tr/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/tr/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/tr/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/tr/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/uk/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/uk/FilterBar.js +88 -0
- data/app/assets/javascripts/gridx/nls/uk/NestedSort.js +12 -0
- data/app/assets/javascripts/gridx/nls/uk/PaginationBar.js +28 -0
- data/app/assets/javascripts/gridx/nls/uk/QuickFilter.js +8 -0
- data/app/assets/javascripts/gridx/nls/uk/SummaryBar.js +6 -0
- data/app/assets/javascripts/gridx/nls/zh/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/zh/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/zh/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/zh/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/zh/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/zh/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/nls/zh-tw/Body.js +11 -0
- data/app/assets/javascripts/gridx/nls/zh-tw/FilterBar.js +89 -0
- data/app/assets/javascripts/gridx/nls/zh-tw/NestedSort.js +11 -0
- data/app/assets/javascripts/gridx/nls/zh-tw/PaginationBar.js +34 -0
- data/app/assets/javascripts/gridx/nls/zh-tw/QuickFilter.js +7 -0
- data/app/assets/javascripts/gridx/nls/zh-tw/SummaryBar.js +5 -0
- data/app/assets/javascripts/gridx/support/DropDownPager.js +111 -0
- data/app/assets/javascripts/gridx/support/DropDownSizer.js +112 -0
- data/app/assets/javascripts/gridx/support/GotoPageButton.js +92 -0
- data/app/assets/javascripts/gridx/support/GotoPagePane.js +61 -0
- data/app/assets/javascripts/gridx/support/LinkPager.js +180 -0
- data/app/assets/javascripts/gridx/support/LinkSizer.js +138 -0
- data/app/assets/javascripts/gridx/support/QuickFilter.js +138 -0
- data/app/assets/javascripts/gridx/support/Summary.js +49 -0
- data/app/assets/javascripts/gridx/support/_LinkPageBase.js +92 -0
- data/app/assets/javascripts/gridx/support/exporter/exporter.js +350 -0
- data/app/assets/javascripts/gridx/support/exporter/toCSV.js +75 -0
- data/app/assets/javascripts/gridx/support/exporter/toTable.js +92 -0
- data/app/assets/javascripts/gridx/support/menu/AZFilterMenu.js +57 -0
- data/app/assets/javascripts/gridx/support/menu/NumberFilterMenu.js +87 -0
- data/app/assets/javascripts/gridx/support/menu/_FilterMenuBase.js +83 -0
- data/app/assets/javascripts/gridx/support/printer.js +157 -0
- data/app/assets/javascripts/gridx/templates/FilterBar.html +8 -0
- data/app/assets/javascripts/gridx/templates/FilterConfirmDialog.html +5 -0
- data/app/assets/javascripts/gridx/templates/FilterDialog.html +19 -0
- data/app/assets/javascripts/gridx/templates/FilterPane.html +64 -0
- data/app/assets/javascripts/gridx/templates/GotoPagePane.html +28 -0
- data/app/assets/javascripts/gridx/templates/Grid.html +19 -0
- data/app/assets/javascripts/gridx/templates/LinkPager.html +24 -0
- data/app/assets/javascripts/gridx/templates/PaginationBar.html +60 -0
- data/app/assets/javascripts/gridx/templates/PaginationBarDD.html +23 -0
- data/app/assets/javascripts/gridx/templates/QuickFilter.html +38 -0
- data/app/assets/stylesheets/gridx/mobile/themes/iphone/Grid.css +107 -0
- data/app/assets/stylesheets/gridx/resources/Dod.css +39 -0
- data/app/assets/stylesheets/gridx/resources/Gridx.css +10 -0
- data/app/assets/stylesheets/gridx/resources/Gridx_rtl.css +5 -0
- data/app/assets/stylesheets/gridx/resources/Tree.css +46 -0
- data/app/assets/stylesheets/gridx/resources/Tree_rtl.css +4 -0
- data/app/assets/stylesheets/gridx/resources/bar.css +24 -0
- data/app/assets/stylesheets/gridx/resources/basic.css +482 -0
- data/app/assets/stylesheets/gridx/resources/basic_rtl.css +37 -0
- data/app/assets/stylesheets/gridx/resources/claro/Gridx.css +16 -0
- data/app/assets/stylesheets/gridx/resources/claro/Gridx_rtl.css +7 -0
- data/app/assets/stylesheets/gridx/resources/claro/basic.css +109 -0
- data/app/assets/stylesheets/gridx/resources/claro/basic_rtl.css +21 -0
- data/app/assets/stylesheets/gridx/resources/claro/filter.css +47 -0
- data/app/assets/stylesheets/gridx/resources/claro/lock.css +19 -0
- data/app/assets/stylesheets/gridx/resources/claro/pagination.css +33 -0
- data/app/assets/stylesheets/gridx/resources/claro/select.css +20 -0
- data/app/assets/stylesheets/gridx/resources/dnd.css +108 -0
- data/app/assets/stylesheets/gridx/resources/filter.css +321 -0
- data/app/assets/stylesheets/gridx/resources/filter_rtl.css +38 -0
- data/app/assets/stylesheets/gridx/resources/lock.css +20 -0
- data/app/assets/stylesheets/gridx/resources/pagination.css +142 -0
- data/app/assets/stylesheets/gridx/resources/pagination_rtl.css +54 -0
- data/app/assets/stylesheets/gridx/resources/select.css +39 -0
- data/app/assets/stylesheets/gridx/resources/sort.css +154 -0
- data/app/assets/stylesheets/gridx/resources/sort_rtl.css +51 -0
- data/lib/gridx-rails/engine.rb +8 -0
- data/lib/gridx-rails/version.rb +3 -0
- data/lib/gridx-rails.rb +4 -0
- data/lib/tasks/gridx-rails_tasks.rake +52 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config/application.rb +59 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +58 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/test.log +78 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/gridx-rails_test.rb +7 -0
- data/test/test_helper.rb +15 -0
- metadata +621 -0
@@ -0,0 +1,540 @@
|
|
1
|
+
define([
|
2
|
+
/*====="../core/Row",=====*/
|
3
|
+
"dojo/_base/declare",
|
4
|
+
"dojo/_base/array",
|
5
|
+
"dojo/_base/lang",
|
6
|
+
"dojo/_base/Deferred",
|
7
|
+
"../core/_Module"
|
8
|
+
], function(/*=====Row, =====*/declare, array, lang, Deferred, _Module){
|
9
|
+
|
10
|
+
/*=====
|
11
|
+
Row.visualIndex = function(){
|
12
|
+
// summary:
|
13
|
+
// Get the visual index (the position in current grid body) of this row.
|
14
|
+
// See documents of the View module for more details on visual index.
|
15
|
+
// returns:
|
16
|
+
// The visual index of this row.
|
17
|
+
};
|
18
|
+
|
19
|
+
var View = declare(_Module, {
|
20
|
+
// summary:
|
21
|
+
// Manages how many and what rows should be shown in the current grid body.
|
22
|
+
// description:
|
23
|
+
// This module defines a key concept: visual index, which is the position of a row in current grid body.
|
24
|
+
// Visual index is important in row rendering because it makes the render logic (or other row related logic)
|
25
|
+
// indenpendent of the data structure. The grid body just asks this View module which row should be rendered
|
26
|
+
// for position 1, and which for position 2, etc, without worrying about paging or tree expansion.
|
27
|
+
// Note the first row in the current grid body always has visual index of zero.
|
28
|
+
// And visual index has no special meaning for child rows in tree grid, so if a root row has visual index 1
|
29
|
+
// and it is expanded, then its first child row will have visual index 2. If that root row is collapsed, its child rows
|
30
|
+
// will have no visual indexes (because not displayed), and its next sibling row will have visual index 2.
|
31
|
+
// Also note that a row with a valid visual index doesn't have to be rendered out or even loaded,
|
32
|
+
// due to the existence of virtual scrolling.
|
33
|
+
|
34
|
+
// rootStart: [readonly] Integer
|
35
|
+
// The row index of the first root row in the current grid body.
|
36
|
+
rootStart: 0,
|
37
|
+
|
38
|
+
// rootCount: [readonly] Integer
|
39
|
+
// The count of root rows that exist in the current grid body.
|
40
|
+
rootCount: 0,
|
41
|
+
|
42
|
+
// visualCount: [readonly] Integer
|
43
|
+
// The count of rows (including children) that should be shown in the current grid body.
|
44
|
+
visualCount: 0,
|
45
|
+
|
46
|
+
getRowInfo: function(args){
|
47
|
+
// summary:
|
48
|
+
// Get complete row info by partial row info. This function can be used to convert between row index and visual index.
|
49
|
+
// args: View.__RowInfo
|
50
|
+
// A row info object containing partial row info
|
51
|
+
// returns:
|
52
|
+
// A row info object containing as complete as possible row info.
|
53
|
+
},
|
54
|
+
|
55
|
+
logicExpand: function(id){
|
56
|
+
// summary
|
57
|
+
// Logically expand a row (fetching children of the row and update visual index)
|
58
|
+
// tags:
|
59
|
+
// private
|
60
|
+
},
|
61
|
+
|
62
|
+
logicCollapse: function(id){
|
63
|
+
// summary:
|
64
|
+
// Logically collapse a row (update visual index)
|
65
|
+
// tags:
|
66
|
+
// private
|
67
|
+
},
|
68
|
+
|
69
|
+
updateRootRange: function(start, count, skipUpdate){
|
70
|
+
// summary:
|
71
|
+
// Change root range to [start, start + count). Visual index will be updated accordingly.
|
72
|
+
// tags:
|
73
|
+
// private
|
74
|
+
},
|
75
|
+
|
76
|
+
updateVisualCount: function(){
|
77
|
+
// summary:
|
78
|
+
// Update the count of the rows that should be rendered (including child rows) in the current grid body.
|
79
|
+
// This function will fetch all openned rows from store if necessary.
|
80
|
+
// tags:
|
81
|
+
// private
|
82
|
+
// returns:
|
83
|
+
// A Deferred object indicating when the visual count is updated succesfully.
|
84
|
+
},
|
85
|
+
|
86
|
+
onUpdate: function(){
|
87
|
+
// summary:
|
88
|
+
// Fired when root range is changed.
|
89
|
+
// tags:
|
90
|
+
// private
|
91
|
+
}
|
92
|
+
});
|
93
|
+
|
94
|
+
View.__RowInfo = declare([], {
|
95
|
+
// summary:
|
96
|
+
// This structure includes all possible information that can be used to identify a row, it is used
|
97
|
+
// to retrieve a row in grid body.
|
98
|
+
// Usually user only need to provide some of them that is sufficient to uniquely identify a row,
|
99
|
+
// e.g. rowId, or rowIndex and parentId, or visualIndex.
|
100
|
+
|
101
|
+
// rowId: String|Number
|
102
|
+
// The ID of a row.
|
103
|
+
rowId: '',
|
104
|
+
|
105
|
+
// rowIndex: Integer
|
106
|
+
// The index of a row. It is the index below the parent of this row. The parent of root rows is an imaginary row
|
107
|
+
// with id "" (empty string).
|
108
|
+
rowIndex: 0,
|
109
|
+
|
110
|
+
// parentId: String|Number
|
111
|
+
// The parent ID of a row. Should be provided together with rowIndex. Default to root (empty string).
|
112
|
+
parentId: '',
|
113
|
+
|
114
|
+
// visualIndex: Integer
|
115
|
+
// The visual index of a row. It represents the visual position of this row in the current body view.
|
116
|
+
// The visual index of the first row in the current grid body is always zero. Visual index of a row might change
|
117
|
+
// after paging or tree expansion/collapsing, while row index (the index under its parent row) does not.
|
118
|
+
visualIndex: 0
|
119
|
+
});
|
120
|
+
|
121
|
+
View.__CellInfo = declare(View.__RowInfo, {
|
122
|
+
// summary:
|
123
|
+
// This structure includes all possible information that can be used to identify a cell, it is used
|
124
|
+
// to retrieve a cell in grid body.
|
125
|
+
// Usually user only need to provide some of them that is sufficient to uniquely identify the row of a cell,
|
126
|
+
// e.g. rowId, or rowIndex and parentId, or visualIndex.
|
127
|
+
|
128
|
+
// colId: String|Number
|
129
|
+
// The ID of a column (should not be false values)
|
130
|
+
colId: '',
|
131
|
+
|
132
|
+
// colIndex: Integer
|
133
|
+
// The index of a column.
|
134
|
+
colIndex: 0
|
135
|
+
});
|
136
|
+
|
137
|
+
return View;
|
138
|
+
=====*/
|
139
|
+
|
140
|
+
return declare(_Module, {
|
141
|
+
name: 'view',
|
142
|
+
|
143
|
+
load: function(args){
|
144
|
+
var t = this,
|
145
|
+
m = t.model,
|
146
|
+
g = t.grid,
|
147
|
+
persistedOpenInfo = g.persist ? g.persist.registerAndLoad('tree', function(){
|
148
|
+
return t._openInfo;
|
149
|
+
}) : {};
|
150
|
+
t._clear();
|
151
|
+
t.aspect(m, 'onSizeChange', '_onSizeChange');
|
152
|
+
t.aspect(m, 'onDelete', '_onDelete');
|
153
|
+
t.aspect(g, 'setStore', function(){
|
154
|
+
//If server store changes without notifying grid, expanded rows should remain expanded.
|
155
|
+
if(t.arg('clearOnSetStore')){
|
156
|
+
t._clear();
|
157
|
+
}
|
158
|
+
}, t, 'before');
|
159
|
+
t._loadLevels(persistedOpenInfo).then(function(){
|
160
|
+
var size = t._openInfo[''].count = m.size();
|
161
|
+
t.rootCount = t.rootCount || size - t.rootStart;
|
162
|
+
if(t.rootStart + t.rootCount > size){
|
163
|
+
t.rootCount = size - t.rootStart;
|
164
|
+
}
|
165
|
+
for(var id in persistedOpenInfo){
|
166
|
+
t._expand(id);
|
167
|
+
}
|
168
|
+
t._updateVC();
|
169
|
+
t.loaded.callback();
|
170
|
+
}, function(e){
|
171
|
+
t._err = e;
|
172
|
+
t.loaded.callback();
|
173
|
+
});
|
174
|
+
},
|
175
|
+
|
176
|
+
rowMixin: {
|
177
|
+
visualIndex: function(){
|
178
|
+
return this.grid.view.getRowInfo({
|
179
|
+
rowId: this.id
|
180
|
+
}).visualIndex;
|
181
|
+
}
|
182
|
+
},
|
183
|
+
|
184
|
+
clearOnSetStore: true,
|
185
|
+
|
186
|
+
rootStart: 0,
|
187
|
+
|
188
|
+
rootCount: 0,
|
189
|
+
|
190
|
+
visualCount: 0,
|
191
|
+
|
192
|
+
getRowInfo: function(args){
|
193
|
+
var t = this,
|
194
|
+
m = t.model,
|
195
|
+
id = args.rowId;
|
196
|
+
if(m.isId(id)){
|
197
|
+
args.rowIndex = m.idToIndex(id);
|
198
|
+
args.parentId = m.parentId(id);
|
199
|
+
}
|
200
|
+
if(typeof args.rowIndex == 'number' && args.rowIndex >= 0){
|
201
|
+
//Given row index and parentId, get visual index.
|
202
|
+
if(!m.isId(args.parentId)){
|
203
|
+
args.parentId = '';
|
204
|
+
}
|
205
|
+
args.visualIndex = t._getVisualIndex(args.parentId, args.rowIndex);
|
206
|
+
}else if(typeof args.visualIndex == 'number' && args.visualIndex >= 0){
|
207
|
+
//Given visual index, get row index and parent id.
|
208
|
+
var rootOpenned = t._openInfo[''].openned,
|
209
|
+
vi = t.rootStart + args.visualIndex;
|
210
|
+
for(var i = 0; i < rootOpenned.length; ++i){
|
211
|
+
var root = t._openInfo[rootOpenned[i]];
|
212
|
+
if(m.idToIndex(root.id) < t.rootStart){
|
213
|
+
vi += root.count;
|
214
|
+
}else{
|
215
|
+
break;
|
216
|
+
}
|
217
|
+
}
|
218
|
+
var info = {
|
219
|
+
parentId: '',
|
220
|
+
preCount: 0
|
221
|
+
};
|
222
|
+
while(!info.found){
|
223
|
+
info = t._getChild(vi, info);
|
224
|
+
}
|
225
|
+
args.rowIndex = info.rowIndex;
|
226
|
+
args.parentId = info.parentId;
|
227
|
+
}else{
|
228
|
+
//Nothing we can do here...
|
229
|
+
return args;
|
230
|
+
}
|
231
|
+
args.rowId = m.isId(id) ? id : m.indexToId(args.rowIndex, args.parentId);
|
232
|
+
return args;
|
233
|
+
},
|
234
|
+
|
235
|
+
//Package------------------------------------------------------------------------------
|
236
|
+
logicExpand: function(id){
|
237
|
+
var t = this,
|
238
|
+
d = new Deferred();
|
239
|
+
t.model.when({
|
240
|
+
parentId: id,
|
241
|
+
start: 0,
|
242
|
+
count: 1
|
243
|
+
}, function(){
|
244
|
+
if(t._expand(id)){
|
245
|
+
t._updateVC();
|
246
|
+
}
|
247
|
+
}).then(function(){
|
248
|
+
d.callback();
|
249
|
+
}, function(e){
|
250
|
+
d.errback(e);
|
251
|
+
});
|
252
|
+
return d;
|
253
|
+
},
|
254
|
+
|
255
|
+
logicCollapse: function(id){
|
256
|
+
var t = this,
|
257
|
+
openInfo = t._openInfo,
|
258
|
+
info = openInfo[id];
|
259
|
+
if(info){
|
260
|
+
var parentId = t.model.parentId(id),
|
261
|
+
parentOpenInfo = t._parentOpenInfo[parentId],
|
262
|
+
childCount = info.count;
|
263
|
+
parentOpenInfo.splice(array.indexOf(parentOpenInfo, id), 1);
|
264
|
+
info = openInfo[parentId];
|
265
|
+
while(info){
|
266
|
+
info.count -= childCount;
|
267
|
+
info = openInfo[info.parentId];
|
268
|
+
}
|
269
|
+
delete openInfo[id];
|
270
|
+
t.model.free(id, 1);
|
271
|
+
t._updateVC();
|
272
|
+
}
|
273
|
+
},
|
274
|
+
|
275
|
+
updateRootRange: function(start, count, skipUpdate){
|
276
|
+
var t = this;
|
277
|
+
t.rootStart = start;
|
278
|
+
t.rootCount = count;
|
279
|
+
return t.updateVisualCount().then(function(){
|
280
|
+
if(!skipUpdate){
|
281
|
+
t.onUpdate();
|
282
|
+
}
|
283
|
+
});
|
284
|
+
},
|
285
|
+
|
286
|
+
updateVisualCount: function(){
|
287
|
+
var t = this;
|
288
|
+
return t._loadLevels().then(function(){
|
289
|
+
t._updateVC();
|
290
|
+
});
|
291
|
+
},
|
292
|
+
|
293
|
+
//Event---------------------------------------------------------------------------------
|
294
|
+
onUpdate: function(){},
|
295
|
+
|
296
|
+
//Private-------------------------------------------------------------------------------
|
297
|
+
_parentOpenInfo: null,
|
298
|
+
_openInfo: null,
|
299
|
+
|
300
|
+
_clear: function(){
|
301
|
+
var openned = [];
|
302
|
+
this._openInfo = {
|
303
|
+
'': {
|
304
|
+
id: '',
|
305
|
+
parentId: null,
|
306
|
+
path: [],
|
307
|
+
count: 0,
|
308
|
+
openned: openned
|
309
|
+
}
|
310
|
+
};
|
311
|
+
this._parentOpenInfo = {
|
312
|
+
'': openned
|
313
|
+
};
|
314
|
+
},
|
315
|
+
|
316
|
+
_expand: function(id){
|
317
|
+
var t = this,
|
318
|
+
m = t.model;
|
319
|
+
if(m.hasChildren(id)){
|
320
|
+
var parentId = m.parentId(id),
|
321
|
+
openInfo = t._openInfo,
|
322
|
+
poi = t._parentOpenInfo,
|
323
|
+
parentOpenInfo = poi[parentId] = poi[parentId] || [];
|
324
|
+
poi[id] = poi[id] || [];
|
325
|
+
if(!openInfo[id]){
|
326
|
+
var index = m.idToIndex(id);
|
327
|
+
if(index >= 0){
|
328
|
+
m.keep(id, 1);
|
329
|
+
if(array.indexOf(parentOpenInfo, id) < 0){
|
330
|
+
parentOpenInfo.push(id);
|
331
|
+
}
|
332
|
+
var childCount = m.size(id);
|
333
|
+
for(var i = poi[id].length - 1; i >= 0; --i){
|
334
|
+
childCount += openInfo[poi[id][i]].count;
|
335
|
+
}
|
336
|
+
openInfo[id] = {
|
337
|
+
id: id,
|
338
|
+
parentId: parentId,
|
339
|
+
path: m.treePath(id).slice(1).concat([id]),
|
340
|
+
count: childCount,
|
341
|
+
openned: poi[id]
|
342
|
+
};
|
343
|
+
var info = openInfo[parentId];
|
344
|
+
while(info){
|
345
|
+
info.count += childCount;
|
346
|
+
info = openInfo[info.parentId];
|
347
|
+
}
|
348
|
+
return 1;
|
349
|
+
}
|
350
|
+
}
|
351
|
+
}
|
352
|
+
},
|
353
|
+
|
354
|
+
_getVisualIndex: function(parentId, rowIndex){
|
355
|
+
var t = this,
|
356
|
+
m = this.model,
|
357
|
+
openInfo = this._openInfo,
|
358
|
+
info = openInfo[parentId],
|
359
|
+
preCount = 0,
|
360
|
+
rootIndex = parentId === '' ? rowIndex : m.idToIndex(m.rootId(parentId));
|
361
|
+
if(info && rootIndex >= t.rootStart && rootIndex < t.rootStart + t.rootCount){
|
362
|
+
while(info){
|
363
|
+
preCount += rowIndex;
|
364
|
+
for(var i = 0; i < info.openned.length; ++i){
|
365
|
+
var child = openInfo[info.openned[i]],
|
366
|
+
index = m.idToIndex(child.id);
|
367
|
+
if(index < rowIndex && (info.id !== '' || index >= t.rootStart)){
|
368
|
+
preCount += child.count;
|
369
|
+
}
|
370
|
+
}
|
371
|
+
info.openned.sort(function(a, b){
|
372
|
+
return m.idToIndex(a) - m.idToIndex(b);
|
373
|
+
});
|
374
|
+
rowIndex = m.idToIndex(info.id);
|
375
|
+
if(m.isId(info.id)){
|
376
|
+
preCount++;
|
377
|
+
}
|
378
|
+
info = openInfo[info.parentId];
|
379
|
+
}
|
380
|
+
//All child rows before rootStart are not counted in, so minus rootStart directly.
|
381
|
+
return preCount - t.rootStart;
|
382
|
+
}
|
383
|
+
return null;
|
384
|
+
},
|
385
|
+
|
386
|
+
_getChild: function(visualIndex, info){
|
387
|
+
var m = this.model,
|
388
|
+
item = this._openInfo[info.parentId],
|
389
|
+
preCount = info.preCount + m.idToIndex(item.id) + 1,
|
390
|
+
commonMixin = {
|
391
|
+
found: true,
|
392
|
+
visualIndex: visualIndex
|
393
|
+
};
|
394
|
+
//Have to sort the opened rows to calc the visual index.
|
395
|
+
//But if there are too many opened, this sorting will be slow, any better idea?
|
396
|
+
//Note the index can't be maintained since it is changing when sorted or filtered etc.
|
397
|
+
item.openned.sort(function(a, b){
|
398
|
+
return m.idToIndex(a) - m.idToIndex(b);
|
399
|
+
});
|
400
|
+
for(var i = 0, len = item.openned.length; i < len; ++i){
|
401
|
+
var childId = item.openned[i],
|
402
|
+
child = this._openInfo[childId],
|
403
|
+
index = m.idToIndex(childId),
|
404
|
+
vidx = index + preCount;
|
405
|
+
if(vidx === visualIndex){
|
406
|
+
return lang.mixin({
|
407
|
+
parentId: item.id,
|
408
|
+
rowIndex: index
|
409
|
+
}, commonMixin);
|
410
|
+
}else if(vidx < visualIndex && vidx + child.count >= visualIndex){
|
411
|
+
return {
|
412
|
+
parentId: childId,
|
413
|
+
preCount: preCount
|
414
|
+
};
|
415
|
+
}else if(vidx + child.count < visualIndex){
|
416
|
+
preCount += child.count;
|
417
|
+
}
|
418
|
+
}
|
419
|
+
return lang.mixin({
|
420
|
+
parentId: item.id,
|
421
|
+
rowIndex: visualIndex - preCount
|
422
|
+
}, commonMixin);
|
423
|
+
},
|
424
|
+
|
425
|
+
_loadLevels: function(openInfo){
|
426
|
+
openInfo = openInfo || this._openInfo;
|
427
|
+
var m = this.model,
|
428
|
+
d = new Deferred(),
|
429
|
+
id, levels = [];
|
430
|
+
for(id in openInfo){
|
431
|
+
if(m.isId(id)){
|
432
|
+
var i, path = openInfo[id].path;
|
433
|
+
for(i = 0; i < path.length; ++i){
|
434
|
+
levels[i] = levels[i] || [];
|
435
|
+
levels[i].push({
|
436
|
+
parentId: path[i],
|
437
|
+
start: 0,
|
438
|
+
count: 1
|
439
|
+
});
|
440
|
+
}
|
441
|
+
}
|
442
|
+
}
|
443
|
+
var fetchLevel = function(level){
|
444
|
+
if(level < levels.length){
|
445
|
+
m.when(levels[level], function(){
|
446
|
+
array.forEach(levels[level], function(arg){
|
447
|
+
m.keep(arg.parentId, 1);
|
448
|
+
});
|
449
|
+
fetchLevel(level + 1);
|
450
|
+
}).then(null, function(e){
|
451
|
+
d.errback(e);
|
452
|
+
});
|
453
|
+
}else{
|
454
|
+
m.when({}).then(function(){
|
455
|
+
d.callback();
|
456
|
+
}, function(e){
|
457
|
+
d.errback(e);
|
458
|
+
});
|
459
|
+
}
|
460
|
+
};
|
461
|
+
m.when({}, function(){
|
462
|
+
fetchLevel(0);
|
463
|
+
});
|
464
|
+
return d;
|
465
|
+
},
|
466
|
+
|
467
|
+
_updateVC: function(){
|
468
|
+
var t = this,
|
469
|
+
m = t.model,
|
470
|
+
openInfo = t._openInfo,
|
471
|
+
info = openInfo[''],
|
472
|
+
len = info.openned.length,
|
473
|
+
size = t.rootCount,
|
474
|
+
i, child, index;
|
475
|
+
for(i = 0; i < len; ++i){
|
476
|
+
child = openInfo[info.openned[i]];
|
477
|
+
index = m.idToIndex(child.id);
|
478
|
+
if(index >= t.rootStart && index < t.rootStart + t.rootCount){
|
479
|
+
size += child.count;
|
480
|
+
}
|
481
|
+
}
|
482
|
+
t.visualCount = size;
|
483
|
+
},
|
484
|
+
|
485
|
+
_onSizeChange: function(size, oldSize){
|
486
|
+
var t = this;
|
487
|
+
if(!t.paging && t.rootStart === 0 && (t.rootCount === oldSize || oldSize < 0)){
|
488
|
+
t.updateRootRange(0, size);
|
489
|
+
}
|
490
|
+
},
|
491
|
+
|
492
|
+
_onDelete: function(rowId, rowIndex, treePath){
|
493
|
+
if(treePath){
|
494
|
+
var t = this,
|
495
|
+
openInfo = t._openInfo,
|
496
|
+
parentOpenInfo = t._parentOpenInfo,
|
497
|
+
info = openInfo[rowId],
|
498
|
+
model = t.model,
|
499
|
+
parentId = treePath.pop(),
|
500
|
+
count = 1,
|
501
|
+
deleteItem = function(id, parentId){
|
502
|
+
var info = openInfo[id],
|
503
|
+
openedChildren = parentOpenInfo[id] || [];
|
504
|
+
array.forEach(openedChildren, function(child){
|
505
|
+
deleteItem(child);
|
506
|
+
});
|
507
|
+
delete parentOpenInfo[id];
|
508
|
+
if(info){
|
509
|
+
delete openInfo[id];
|
510
|
+
parentId = info.parentId;
|
511
|
+
}else if(!model.isId(parentId)){
|
512
|
+
//FIXME: don't know what to do here...
|
513
|
+
return;
|
514
|
+
}
|
515
|
+
var ppoi = parentOpenInfo[parentId],
|
516
|
+
i = array.indexOf(ppoi, id);
|
517
|
+
if(i >= 0){
|
518
|
+
ppoi.splice(i, 1);
|
519
|
+
}
|
520
|
+
};
|
521
|
+
if(info){
|
522
|
+
count += info.count;
|
523
|
+
info = openInfo[info.parentId];
|
524
|
+
}else if(model.isId(parentId)){
|
525
|
+
info = openInfo[parentId];
|
526
|
+
}
|
527
|
+
deleteItem(rowId, parentId);
|
528
|
+
while(info){
|
529
|
+
info.count -= count;
|
530
|
+
info = openInfo[info.parentId];
|
531
|
+
}
|
532
|
+
t.visualCount -= count;
|
533
|
+
}else{
|
534
|
+
//FIXME: what to do if some unknown row is deleted?
|
535
|
+
this._clear();
|
536
|
+
this.grid.body.lazyRefresh();
|
537
|
+
}
|
538
|
+
}
|
539
|
+
});
|
540
|
+
});
|