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,179 @@
|
|
|
1
|
+
define([
|
|
2
|
+
"dojo/_base/declare",
|
|
3
|
+
"dojo/_base/lang",
|
|
4
|
+
"dojo/_base/array",
|
|
5
|
+
"dojo/dom-class",
|
|
6
|
+
"dojo/string",
|
|
7
|
+
"dojo/query",
|
|
8
|
+
"dojo/keys",
|
|
9
|
+
"dijit/registry",
|
|
10
|
+
"dijit/Dialog",
|
|
11
|
+
"dojox/html/metrics",
|
|
12
|
+
"./FilterPane",
|
|
13
|
+
"dojo/text!../../templates/FilterDialog.html",
|
|
14
|
+
"dijit/form/Select",
|
|
15
|
+
"dijit/form/Button",
|
|
16
|
+
"dijit/layout/AccordionContainer"
|
|
17
|
+
], function(declare, lang, array, css, string, query, keys, registry, Dialog, metrics, FilterPane, template){
|
|
18
|
+
|
|
19
|
+
/*=====
|
|
20
|
+
return declare([], {
|
|
21
|
+
});
|
|
22
|
+
=====*/
|
|
23
|
+
|
|
24
|
+
return declare(Dialog, {
|
|
25
|
+
cssClass: 'gridxFilterDialog',
|
|
26
|
+
grid: null,
|
|
27
|
+
autofocus: false,
|
|
28
|
+
|
|
29
|
+
postCreate: function(){
|
|
30
|
+
this.inherited(arguments);
|
|
31
|
+
this.i18n = this.grid.filterBar._nls;
|
|
32
|
+
this.set('content', string.substitute(template, this));
|
|
33
|
+
this._initWidgets();
|
|
34
|
+
css.add(this.domNode, 'gridxFilterDialog');
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
done: function(){
|
|
38
|
+
// summary:
|
|
39
|
+
// Apply the filter.
|
|
40
|
+
this.hide();
|
|
41
|
+
this.grid.filterBar.applyFilter(this.getData());
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
getData: function(){
|
|
45
|
+
// summary:
|
|
46
|
+
// Get filter data.
|
|
47
|
+
return {
|
|
48
|
+
type: this._sltMatch.get('value'),
|
|
49
|
+
conditions: array.map(this._accordionContainer.getChildren(), function(p){
|
|
50
|
+
return p.getData();
|
|
51
|
+
})
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
setData: function(data){
|
|
56
|
+
// summary:
|
|
57
|
+
// Set filter data.
|
|
58
|
+
this.removeChildren();
|
|
59
|
+
if(!data || !data.conditions.length){
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
this._sltMatch.set('value', 'all' && data && data.type);
|
|
63
|
+
array.forEach(data.conditions, function(d){
|
|
64
|
+
this.addRule().setData(d);
|
|
65
|
+
}, this);
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
removeChildren: function(){
|
|
69
|
+
// summary:
|
|
70
|
+
// Remove all child of the accodion container.
|
|
71
|
+
array.forEach(this._accordionContainer.getChildren(), function(child){
|
|
72
|
+
this._accordionContainer.removeChild(child);
|
|
73
|
+
child.destroy();
|
|
74
|
+
}, this);
|
|
75
|
+
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
clear: function(){
|
|
79
|
+
this.grid.filterBar.confirmToExecute(function(){
|
|
80
|
+
this.grid.filterBar.clearFilter(true);
|
|
81
|
+
this.hide();
|
|
82
|
+
}, this);
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
cancel: function(){
|
|
86
|
+
this.hide();
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
show: function(){
|
|
90
|
+
this.inherited(arguments);
|
|
91
|
+
if(!this._accordionContainer.hasChildren()){
|
|
92
|
+
this.addRule();
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
addRule: function(){
|
|
97
|
+
var ac = this._accordionContainer;
|
|
98
|
+
if(ac.getChildren().length === 3){
|
|
99
|
+
ac._contentBox.w -= metrics.getScrollbar().w;
|
|
100
|
+
}
|
|
101
|
+
var nextRuleNumber = ac.getChildren().length + 1;
|
|
102
|
+
var ruleTitle = string.substitute(this.i18n.ruleTitleTemplate, {ruleNumber: nextRuleNumber});
|
|
103
|
+
var fp = new FilterPane({grid: this.grid, title: ruleTitle});
|
|
104
|
+
ac.addChild(fp);
|
|
105
|
+
ac.selectChild(fp);
|
|
106
|
+
|
|
107
|
+
if(!this._titlePaneHeight){
|
|
108
|
+
this._titlePaneHeight = fp._buttonWidget.domNode.offsetHeight + 3;
|
|
109
|
+
}
|
|
110
|
+
fp._initCloseButton();
|
|
111
|
+
fp._onColumnChange();
|
|
112
|
+
try{
|
|
113
|
+
fp.tbSingle.focus();//TODO: this doesn't work now.
|
|
114
|
+
}catch(e){}
|
|
115
|
+
css.toggle(ac.domNode, 'gridxFilterSingleRule', ac.getChildren().length === 1);
|
|
116
|
+
|
|
117
|
+
fp.connect(fp, 'onChange', lang.hitch(this, '_updateButtons'));
|
|
118
|
+
this._updateButtons();
|
|
119
|
+
this._updateAccordionContainerHeight();
|
|
120
|
+
//scroll to bottom when add a rule
|
|
121
|
+
ac.domNode.parentNode.scrollTop = 100000;
|
|
122
|
+
return fp;
|
|
123
|
+
},
|
|
124
|
+
|
|
125
|
+
_initWidgets: function(){
|
|
126
|
+
var form = dojo.query('form', this.domNode)[0], _this = this;
|
|
127
|
+
form.onsubmit = function(){
|
|
128
|
+
_this.done();
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
this._accordionContainer = registry.byNode(query('.dijitAccordionContainer', this.domNode)[0]);
|
|
132
|
+
this._sltMatch = registry.byNode(query('.dijitSelect', this.domNode)[0]);
|
|
133
|
+
var btns = query('.dijitButton', this.domNode);
|
|
134
|
+
this._btnAdd = registry.byNode(btns[0]);
|
|
135
|
+
this._btnFilter = registry.byNode(btns[1]);
|
|
136
|
+
this._btnClear = registry.byNode(btns[2]);
|
|
137
|
+
this._btnCancel = registry.byNode(btns[3]);
|
|
138
|
+
this.connect(this._btnAdd, 'onClick', 'addRule');
|
|
139
|
+
this.connect(this._btnClear, 'onClick', 'clear');
|
|
140
|
+
this.connect(this._btnCancel, 'onClick', 'cancel');
|
|
141
|
+
this.connect(this._accordionContainer, 'removeChild', '_updateButtons');
|
|
142
|
+
this.connect(this._accordionContainer, 'removeChild', '_updatePaneTitle');
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
_updatePaneTitle: function(){
|
|
146
|
+
// summary:
|
|
147
|
+
// Update each pane title. Only called after remove a RULE pane.
|
|
148
|
+
array.forEach(this._accordionContainer.getChildren(), function(pane){
|
|
149
|
+
pane._updateTitle();
|
|
150
|
+
});
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
_updateButtons: function(){
|
|
154
|
+
var children = this._accordionContainer.getChildren();
|
|
155
|
+
//toggle filter button disable
|
|
156
|
+
if(array.some(children, function(c){return c.getData() === null;})){
|
|
157
|
+
this._btnFilter.set('disabled', true);
|
|
158
|
+
}else{
|
|
159
|
+
this._btnFilter.set('disabled', false);
|
|
160
|
+
}
|
|
161
|
+
//toggle add rule button disable
|
|
162
|
+
var c = this.grid.filterBar.arg('maxRuleCount');
|
|
163
|
+
this._btnAdd.set('disabled', children.length >= c && c > 0);
|
|
164
|
+
this._btnClear.set('disabled', !this.grid.filterBar.filterData);
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
_updateAccordionContainerHeight: function(){
|
|
168
|
+
// summary:
|
|
169
|
+
// Update the height of the accordion container to ensure consistent height of each accordion pane.
|
|
170
|
+
var ac = this._accordionContainer, len = ac.getChildren().length;
|
|
171
|
+
ac.domNode.style.height = 145 + len * this._titlePaneHeight + 'px';
|
|
172
|
+
ac.resize();
|
|
173
|
+
},
|
|
174
|
+
uninitialize: function(){
|
|
175
|
+
this.inherited(arguments);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
});
|
|
179
|
+
});
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
define([
|
|
2
|
+
"dojo/_base/declare",
|
|
3
|
+
"dojo/_base/lang",
|
|
4
|
+
"dojo/_base/array",
|
|
5
|
+
"dojo/dom-construct",
|
|
6
|
+
"dojo/dom-class",
|
|
7
|
+
"dojo/string",
|
|
8
|
+
"dojo/query",
|
|
9
|
+
"dijit/registry",
|
|
10
|
+
"dojox/html/ellipsis",
|
|
11
|
+
"dojox/html/metrics",
|
|
12
|
+
"./DistinctComboBoxMenu",
|
|
13
|
+
"../Filter",
|
|
14
|
+
"dojo/text!../../templates/FilterPane.html",
|
|
15
|
+
"dojo/i18n!../../nls/FilterBar",
|
|
16
|
+
"dijit/layout/ContentPane",
|
|
17
|
+
"dijit/_BidiSupport",
|
|
18
|
+
"dijit/form/Select",
|
|
19
|
+
"dijit/form/TextBox",
|
|
20
|
+
"dijit/form/DateTextBox",
|
|
21
|
+
"dijit/form/TimeTextBox",
|
|
22
|
+
"dijit/form/RadioButton",
|
|
23
|
+
"dijit/form/NumberTextBox",
|
|
24
|
+
"dijit/form/ComboBox"
|
|
25
|
+
], function(declare, lang, array, dom, css, string, query, registry, ellipsis, metrics, DistinctComboBoxMenu, Filter, template, i18n, ContentPane, _BidiSupport){
|
|
26
|
+
|
|
27
|
+
/*=====
|
|
28
|
+
return declare([], {
|
|
29
|
+
});
|
|
30
|
+
=====*/
|
|
31
|
+
|
|
32
|
+
var ANY_COLUMN_VALUE = '_gridx_any_column_value_';
|
|
33
|
+
|
|
34
|
+
function isAnyColumn(colid){
|
|
35
|
+
return colid == ANY_COLUMN_VALUE;
|
|
36
|
+
}
|
|
37
|
+
return declare([ContentPane], {
|
|
38
|
+
//content: template,
|
|
39
|
+
sltColumn: null,
|
|
40
|
+
sltCondition: null,
|
|
41
|
+
grid: null,
|
|
42
|
+
postCreate: function(){
|
|
43
|
+
this.inherited(arguments);
|
|
44
|
+
this.i18n = this.grid.filterBar._nls;
|
|
45
|
+
this.set('title', this.i18n.defaultRuleTitle);
|
|
46
|
+
this.set('content', string.substitute(template, this));
|
|
47
|
+
this._initFields();
|
|
48
|
+
this._initSltCol();
|
|
49
|
+
this.connect(this.sltColumn, 'onChange', '_onColumnChange');
|
|
50
|
+
this.connect(this.sltCondition, 'onChange', '_onConditionChange');
|
|
51
|
+
this.comboText.dropDownClass = DistinctComboBoxMenu;
|
|
52
|
+
this._onConditionChange();//In the latest dijit, onChange event is no longer fired after creation
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
getData: function(){
|
|
56
|
+
// summary:
|
|
57
|
+
// Get the filter defined by this filter pane.
|
|
58
|
+
var value = this._getValue(),
|
|
59
|
+
colId = this.sltColumn.get('value'),
|
|
60
|
+
condition = this.sltCondition.get('value');
|
|
61
|
+
|
|
62
|
+
if(condition === 'isEmpty' || (value !== null && (condition !== 'range' || (value.start && value.end)))){
|
|
63
|
+
return {
|
|
64
|
+
colId: isAnyColumn(colId) ? '' : colId,
|
|
65
|
+
condition: condition,
|
|
66
|
+
//fix defect #10741
|
|
67
|
+
//set('value', '') on DateTimeBox will set date to 1/1/1970
|
|
68
|
+
//so, set('value', null) when condition is empty on a DateTimeBoxs
|
|
69
|
+
value: condition === 'isEmpty'? ( this._getType() === 'Date'? null : '') : value,
|
|
70
|
+
type: this._getType()
|
|
71
|
+
};
|
|
72
|
+
}else{
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
setData: function(data){
|
|
77
|
+
// summary:
|
|
78
|
+
// Set the data of the pane to restore UI.
|
|
79
|
+
if(data === null){return;}
|
|
80
|
+
this.sltColumn.set('value', data.colId, null);
|
|
81
|
+
this._onColumnChange();
|
|
82
|
+
var _this = this;
|
|
83
|
+
|
|
84
|
+
window.setTimeout(function(){
|
|
85
|
+
_this.sltCondition.set('value', data.condition, null);
|
|
86
|
+
_this._onConditionChange();
|
|
87
|
+
_this._setValue(data.value);
|
|
88
|
+
}, 10);
|
|
89
|
+
},
|
|
90
|
+
close: function(){
|
|
91
|
+
var ac = this._getContainer();
|
|
92
|
+
if(ac.getChildren().length === 4){
|
|
93
|
+
//while there's less than 4 rules, no scroll bar
|
|
94
|
+
ac._contentBox.w += metrics.getScrollbar().w;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if(this === ac.selectedChildWidget){
|
|
98
|
+
//select previous pane if this is current, consistent with EDG filter.
|
|
99
|
+
var i = array.indexOf(ac.getChildren(), this);
|
|
100
|
+
if(i > 0){ac.selectChild(ac.getChildren()[i-1]);}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
ac.removeChild(this);
|
|
104
|
+
css.toggle(ac.domNode, 'gridxFilterSingleRule', ac.getChildren().length === 1);
|
|
105
|
+
this.grid.filterBar._filterDialog._updateAccordionContainerHeight();
|
|
106
|
+
},
|
|
107
|
+
onChange: function(){
|
|
108
|
+
// summary:
|
|
109
|
+
// event: fired when column, condition or value is changed
|
|
110
|
+
},
|
|
111
|
+
_getContainer: function(){
|
|
112
|
+
return registry.byNode(this.domNode.parentNode.parentNode.parentNode);
|
|
113
|
+
},
|
|
114
|
+
_initFields: function(){
|
|
115
|
+
this.sltColumn = registry.byNode(query('li>table', this.domNode)[0]);
|
|
116
|
+
this.sltCondition = registry.byNode(query('li>table', this.domNode)[1]);
|
|
117
|
+
var fields = this._fields = [
|
|
118
|
+
this.tbSingle = registry.byNode(query('.gridxFilterPaneTextWrapper > .dijitTextBox', this.domNode)[0]),
|
|
119
|
+
this.tbNumber = registry.byNode(query('.gridxFilterPaneNumberWrapper > .dijitTextBox', this.domNode)[0]),
|
|
120
|
+
this.comboText = registry.byNode(query('.gridxFilterPaneComboWrapper > .dijitComboBox', this.domNode)[0]),
|
|
121
|
+
this.sltSingle = registry.byNode(query('.gridxFilterPaneSelectWrapper > .dijitSelect', this.domNode)[0]),
|
|
122
|
+
this.dtbSingle = registry.byNode(query('.gridxFilterPaneDateWrapper > .dijitDateTextBox', this.domNode)[0]),
|
|
123
|
+
this.dtbStart = registry.byNode(query('.gridxFilterPaneDateRangeWrapper > .dijitDateTextBox', this.domNode)[0]),
|
|
124
|
+
this.dtbEnd = registry.byNode(query('.gridxFilterPaneDateRangeWrapper > .dijitDateTextBox', this.domNode)[1]),
|
|
125
|
+
this.ttbSingle = registry.byNode(query('.gridxFilterPaneTimeWrapper > .dijitTimeTextBox', this.domNode)[0]),
|
|
126
|
+
this.ttbStart = registry.byNode(query('.gridxFilterPaneTimeRangeWrapper > .dijitTimeTextBox', this.domNode)[0]),
|
|
127
|
+
this.ttbEnd = registry.byNode(query('.gridxFilterPaneTimeRangeWrapper > .dijitTimeTextBox', this.domNode)[1]),
|
|
128
|
+
this.rbTrue = registry.byNode(query('.gridxFilterPaneRadioWrapper .dijitRadio', this.domNode)[0]),
|
|
129
|
+
this.rbFalse = registry.byNode(query('.gridxFilterPaneRadioWrapper .dijitRadio', this.domNode)[1])
|
|
130
|
+
];
|
|
131
|
+
|
|
132
|
+
this.rbTrue.domNode.nextSibling.htmlFor = this.rbTrue.id;
|
|
133
|
+
this.rbFalse.domNode.nextSibling.htmlFor = this.rbFalse.id;
|
|
134
|
+
var name = 'rb_name_' + Math.random();
|
|
135
|
+
this.rbTrue.set('name', name);
|
|
136
|
+
this.rbFalse.set('name', name);
|
|
137
|
+
|
|
138
|
+
array.forEach(fields, function(field){
|
|
139
|
+
this.connect(field, 'onChange', '_onValueChange');
|
|
140
|
+
}, this);
|
|
141
|
+
},
|
|
142
|
+
_initSltCol: function(){
|
|
143
|
+
var colOpts = [{label: this.i18n.anyColumnOption, value: ANY_COLUMN_VALUE}],
|
|
144
|
+
fb = this.grid.filterBar,
|
|
145
|
+
sltCol = this.sltColumn;
|
|
146
|
+
array.forEach(this.grid.columns(), function(col){
|
|
147
|
+
if(!col.isFilterable())return;
|
|
148
|
+
var colName = col.name();
|
|
149
|
+
colName = this.grid.enforceTextDirWithUcc(col.id, colName);
|
|
150
|
+
colOpts.push({value: col.id, label: colName});
|
|
151
|
+
}, this);
|
|
152
|
+
sltCol.addOption(colOpts);
|
|
153
|
+
},
|
|
154
|
+
_initCloseButton: function(){
|
|
155
|
+
// summary:
|
|
156
|
+
// Add a close button to the accordion pane.
|
|
157
|
+
// Must be called after adding to an accordion container.
|
|
158
|
+
var btnWidget = this._buttonWidget;
|
|
159
|
+
var closeButton = dom.create('span', {
|
|
160
|
+
className: 'gridxFilterPaneCloseButton',
|
|
161
|
+
innerHTML: '<img src="' + this._blankGif + '"/>',
|
|
162
|
+
tabIndex: 0,
|
|
163
|
+
title: this.i18n.removeRuleButton || ''
|
|
164
|
+
}, btnWidget.domNode, 'last');
|
|
165
|
+
this.connect(closeButton, 'onclick', 'close');
|
|
166
|
+
css.add(btnWidget.titleTextNode, 'dojoxEllipsis');
|
|
167
|
+
},
|
|
168
|
+
|
|
169
|
+
_onColumnChange: function(){
|
|
170
|
+
var colId = this.sltColumn.get('value');
|
|
171
|
+
var opt = this.grid.filterBar._getConditionOptions(isAnyColumn(colId) ? '' : colId);
|
|
172
|
+
var slt = this.sltCondition;
|
|
173
|
+
//if(slt.options && slt.options.length){slt.removeOption(slt.options);}
|
|
174
|
+
slt.set('options', []);
|
|
175
|
+
slt.addOption(lang.clone(opt));
|
|
176
|
+
this._updateTitle();
|
|
177
|
+
this._updateValueField();
|
|
178
|
+
this.onChange();
|
|
179
|
+
},
|
|
180
|
+
_onConditionChange: function(){
|
|
181
|
+
this._updateValueField();
|
|
182
|
+
this._updateTitle();
|
|
183
|
+
this.onChange();
|
|
184
|
+
},
|
|
185
|
+
_onValueChange: function(){
|
|
186
|
+
if(this.grid.textDir && this.grid.textDir == 'auto'){
|
|
187
|
+
this.tbSingle.focusNode.dir = _BidiSupport.prototype._checkContextual(this._getValue());
|
|
188
|
+
}
|
|
189
|
+
this._updateTitle();
|
|
190
|
+
this.onChange();
|
|
191
|
+
},
|
|
192
|
+
_getDataType: function(){
|
|
193
|
+
// summary:
|
|
194
|
+
// Get current column data type
|
|
195
|
+
var colid = this.sltColumn.get('value');
|
|
196
|
+
var dataType = 'string';
|
|
197
|
+
if(!isAnyColumn(colid)){
|
|
198
|
+
dataType = this.grid.column(colid).dataType();
|
|
199
|
+
}
|
|
200
|
+
return dataType;
|
|
201
|
+
},
|
|
202
|
+
_getType: function(){
|
|
203
|
+
// summary:
|
|
204
|
+
// Get current filter type, determined by data type and condition.
|
|
205
|
+
var mapping = {'string': 'Text', number: 'Number', date: 'Date', time: 'Time', 'enum': 'Select', 'boolean': 'Radio'};
|
|
206
|
+
var type = mapping[this._getDataType()];
|
|
207
|
+
if('range' === this.sltCondition.get('value')){type += 'Range';} ;
|
|
208
|
+
return type;
|
|
209
|
+
},
|
|
210
|
+
_updateTitle: function(){
|
|
211
|
+
if(!this._buttonWidget){return;}
|
|
212
|
+
var title, value = this._getValue(),
|
|
213
|
+
type = this._getType(), condition = this.sltCondition.get('value'),
|
|
214
|
+
txtNode = this._buttonWidget.titleTextNode;
|
|
215
|
+
|
|
216
|
+
if(this._isValidValue(value) && (condition !== 'range' || (value.start && value.end))){
|
|
217
|
+
title = this.sltColumn.get('displayedValue') + ' ' + this.grid.filterBar._getRuleString(condition, value, type);
|
|
218
|
+
}else{
|
|
219
|
+
var ruleNumber = array.indexOf(this._getContainer().getChildren(), this) + 1;
|
|
220
|
+
title = string.substitute(this.i18n.ruleTitleTemplate, {ruleNumber: ruleNumber});
|
|
221
|
+
}
|
|
222
|
+
txtNode.innerHTML = title;
|
|
223
|
+
txtNode.title = title.replace(/<\/?span[^>]*>/g, '').replace(' ', ' ');
|
|
224
|
+
},
|
|
225
|
+
_needComboBox: function(){
|
|
226
|
+
// summary:
|
|
227
|
+
// Whether current state needs a combo box for string input, may rewrite to support virtual column
|
|
228
|
+
var colId = this.sltColumn.get('value');
|
|
229
|
+
return this._getType() === 'Text' && !isAnyColumn(colId) && this.grid._columnsById[colId].field;
|
|
230
|
+
},
|
|
231
|
+
_updateValueField: function(){
|
|
232
|
+
// summary:
|
|
233
|
+
// Update the UI for field to show/hide fields.
|
|
234
|
+
var type = this._getType(), colId = this.sltColumn.get('value');
|
|
235
|
+
var combo = this._needComboBox();
|
|
236
|
+
|
|
237
|
+
array.forEach(['Text','Combo', 'Date', 'Number', 'DateRange', 'Time', 'TimeRange', 'Select', 'Radio'], function(k){
|
|
238
|
+
css.remove(this.domNode, 'gridxFilterPane' + k);
|
|
239
|
+
}, this);
|
|
240
|
+
|
|
241
|
+
css.add(this.domNode, 'gridxFilterPane' + (combo ? 'Combo' : type));
|
|
242
|
+
var disabled = this.sltCondition.get('value') === 'isEmpty';
|
|
243
|
+
array.forEach(this._fields, function(f){f.set('disabled', disabled)});
|
|
244
|
+
|
|
245
|
+
var col = this.grid._columnsById[colId];
|
|
246
|
+
if(combo){
|
|
247
|
+
if(!this._dummyCombo){
|
|
248
|
+
//HACK: mixin query, get, etc methods to store, remove from 2.0.
|
|
249
|
+
this._dummyCombo = new dijit.form.ComboBox({store: this.grid.store});
|
|
250
|
+
}
|
|
251
|
+
//init combobox
|
|
252
|
+
if(col.autoComplete !== false){
|
|
253
|
+
lang.mixin(this.comboText, {
|
|
254
|
+
store: this.grid.store,
|
|
255
|
+
searchAttr: col.field,
|
|
256
|
+
fetchProperties: {sort:[{attribute: col.field, descending: false}]}
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
if(type == 'Select'){
|
|
261
|
+
var sltSingle = this.sltSingle;
|
|
262
|
+
sltSingle.removeOption(sltSingle.getOptions());
|
|
263
|
+
sltSingle.addOption(array.map(col.enumOptions || [], function(option){
|
|
264
|
+
return lang.isObject(option) ? option : {
|
|
265
|
+
label: option,
|
|
266
|
+
value: option
|
|
267
|
+
};
|
|
268
|
+
}));
|
|
269
|
+
this._updateTitle();
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
_getValue: function(){
|
|
273
|
+
// summary:
|
|
274
|
+
// Get current filter value
|
|
275
|
+
var type = this._getType(), combo = this._needComboBox();
|
|
276
|
+
switch(type){
|
|
277
|
+
case 'Text':
|
|
278
|
+
return (combo ? this.comboText : this.tbSingle).get('value') || null;
|
|
279
|
+
case 'Number':
|
|
280
|
+
return isNaN(this.tbNumber.get('value')) ? null : this.tbNumber.get('value');
|
|
281
|
+
case 'Select':
|
|
282
|
+
return this.sltSingle.get('value') || null;
|
|
283
|
+
case 'Date':
|
|
284
|
+
return this.dtbSingle.get('value') || null;
|
|
285
|
+
case 'DateRange':
|
|
286
|
+
return {start: this.dtbStart.get('value'), end: this.dtbEnd.get('value')};
|
|
287
|
+
case 'Time':
|
|
288
|
+
return this.ttbSingle.get('value') || null;
|
|
289
|
+
case 'TimeRange':
|
|
290
|
+
return {start: this.ttbStart.get('value'), end: this.ttbEnd.get('value')};
|
|
291
|
+
case 'Radio':
|
|
292
|
+
return !!this.rbTrue.get('checked');
|
|
293
|
+
default:
|
|
294
|
+
return null;
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
_setValue: function(value){
|
|
298
|
+
if(!this._isValidValue(value)){return;}
|
|
299
|
+
var type = this._getType(), combo = this._needComboBox();
|
|
300
|
+
switch(type){
|
|
301
|
+
case 'Text':
|
|
302
|
+
(combo ? this.comboText : this.tbSingle).set('value', value);
|
|
303
|
+
break;
|
|
304
|
+
case 'Number':
|
|
305
|
+
this.tbNumber.set('value', value);
|
|
306
|
+
break;
|
|
307
|
+
case 'Select':
|
|
308
|
+
this.sltSingle.set('value', value);
|
|
309
|
+
break;
|
|
310
|
+
case 'Date':
|
|
311
|
+
this.dtbSingle.set('value', value);
|
|
312
|
+
break;
|
|
313
|
+
case 'DateRange':
|
|
314
|
+
this.dtbStart.set('value', value.start);
|
|
315
|
+
this.dtbEnd.set('value', value.end);
|
|
316
|
+
break;
|
|
317
|
+
case 'Time':
|
|
318
|
+
this.ttbSingle.set('value', value);
|
|
319
|
+
break;
|
|
320
|
+
case 'TimeRange':
|
|
321
|
+
this.ttbStart.set('value', value.start);
|
|
322
|
+
this.ttbEnd.set('value', value.end);
|
|
323
|
+
break;
|
|
324
|
+
case 'Radio':
|
|
325
|
+
if(value){this.rbTrue.set('checked', true);}
|
|
326
|
+
else{this.rbFalse.set('checked', true);}
|
|
327
|
+
break;
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
|
|
331
|
+
_isValidValue: function(value){
|
|
332
|
+
return value !== null && value != undefined;
|
|
333
|
+
},
|
|
334
|
+
|
|
335
|
+
uninitialize: function(){
|
|
336
|
+
this.inherited(arguments);
|
|
337
|
+
if(this._dummyCombo){this._dummyCombo.destroyRecursive();}
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
});
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
define([
|
|
2
|
+
"dojo/_base/array",
|
|
3
|
+
"dojo/_base/event",
|
|
4
|
+
"dojo/dom-class",
|
|
5
|
+
"dijit/popup",
|
|
6
|
+
"dojo/_base/declare",
|
|
7
|
+
"dojo/string",
|
|
8
|
+
"dijit/TooltipDialog"
|
|
9
|
+
], function(array, event, domClass, popup, declare, string, TooltipDialog){
|
|
10
|
+
|
|
11
|
+
/*=====
|
|
12
|
+
return declare([], {
|
|
13
|
+
// summary:
|
|
14
|
+
// Show status dialog of filter.
|
|
15
|
+
});
|
|
16
|
+
=====*/
|
|
17
|
+
|
|
18
|
+
return declare(TooltipDialog, {
|
|
19
|
+
grid: null,
|
|
20
|
+
filterBar: null,
|
|
21
|
+
postCreate: function(){
|
|
22
|
+
this.inherited(arguments);
|
|
23
|
+
this.filterBar = this.grid.filterBar;
|
|
24
|
+
this.connect(this, 'onClick', '_onClick');
|
|
25
|
+
this.connect(this, 'onMouseEnter', '_onMouseEnter');
|
|
26
|
+
this.connect(this, 'onMouseLeave', '_onMouseLeave');
|
|
27
|
+
domClass.add(this.domNode, 'gridxFilterTooltip');
|
|
28
|
+
domClass.add(this.domNode, 'dijitTooltipBelow');
|
|
29
|
+
},
|
|
30
|
+
show: function(evt){
|
|
31
|
+
this.inherited(arguments);
|
|
32
|
+
popup.open({
|
|
33
|
+
popup: this,
|
|
34
|
+
x: evt.pageX,
|
|
35
|
+
y: evt.pageY,
|
|
36
|
+
padding: {x: -6, y: -3}
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
hide: function(){
|
|
40
|
+
this.inherited(arguments);
|
|
41
|
+
popup.close(this);
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
buildContent: function(){
|
|
45
|
+
// summary:
|
|
46
|
+
// Build the status of current filter.
|
|
47
|
+
|
|
48
|
+
var fb = this.filterBar, nls = fb._nls, data = fb.filterData;
|
|
49
|
+
if(!data || !data.conditions.length){return;}
|
|
50
|
+
|
|
51
|
+
var typeString = data.type === 'all' ? nls.statusTipHeaderAll : nls.statusTipHeaderAny;
|
|
52
|
+
var arr = ['<div class="gridxFilterTooltipTitle"><b>${i18n.statusTipTitleHasFilter}</b> ',
|
|
53
|
+
typeString, '</div><table><tr><th>${i18n.statusTipHeaderColumn}</th><th>${i18n.statusTipHeaderCondition}</th></tr>'
|
|
54
|
+
];
|
|
55
|
+
array.forEach(data.conditions, function(d, idx){
|
|
56
|
+
var odd = idx%2 ? ' class="gridxFilterTooltipOddRow"' : '';
|
|
57
|
+
if(d.colId){
|
|
58
|
+
var colName = this.grid.column(d.colId).name();
|
|
59
|
+
colName = this.grid.enforceTextDirWithUcc(d.colId, colName);
|
|
60
|
+
}
|
|
61
|
+
arr.push('<tr', odd, '><td>', (d.colId ? colName : '${i18n.anyColumnOption}'),
|
|
62
|
+
'</td><td class="gridxFilterTooltipValueCell">',
|
|
63
|
+
'<div>',
|
|
64
|
+
fb._getRuleString(d.condition, d.value, d.type),
|
|
65
|
+
'<span action="remove-rule" title="${i18n.removeRuleButton}"',
|
|
66
|
+
' class="gridxFilterTooltipRemoveBtn"><span class="gridxFilterTooltipRemoveBtnText">x</span></span></div></td></tr>');
|
|
67
|
+
}, this);
|
|
68
|
+
arr.push('</table>');
|
|
69
|
+
this.i18n = this.grid.filterBar._nls;
|
|
70
|
+
this.set('content', string.substitute(arr.join(''), this));
|
|
71
|
+
domClass.toggle(this.domNode, 'gridxFilterTooltipSingleRule', data.conditions.length === 1);
|
|
72
|
+
},
|
|
73
|
+
_onMouseEnter: function(e){
|
|
74
|
+
this.isMouseOn = true;
|
|
75
|
+
},
|
|
76
|
+
_onMouseLeave: function(e){
|
|
77
|
+
this.isMouseOn = false;
|
|
78
|
+
this.hide();
|
|
79
|
+
},
|
|
80
|
+
_onClick: function(e){
|
|
81
|
+
var tr = this._getTr(e), fb = this.filterBar;
|
|
82
|
+
if(tr && /^span$/i.test(e.target.tagName)){
|
|
83
|
+
//remove the rule
|
|
84
|
+
fb.filterData.conditions.splice(tr.rowIndex - 1, 1);
|
|
85
|
+
tr.parentNode.removeChild(tr);
|
|
86
|
+
fb.applyFilter(fb.filterData);
|
|
87
|
+
event.stop(e);
|
|
88
|
+
}else{
|
|
89
|
+
this.filterBar.showFilterDialog();
|
|
90
|
+
this.hide();
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
_getTr: function(e){
|
|
94
|
+
// summary:
|
|
95
|
+
// Get table row of status
|
|
96
|
+
var tr = e.target;
|
|
97
|
+
while(tr && !/^tr$/i.test(tr.tagName) && tr !== this.domNode){
|
|
98
|
+
tr = tr.parentNode;
|
|
99
|
+
}
|
|
100
|
+
return (tr && /^tr$/i.test(tr.tagName)) ? tr : null;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
define([
|
|
2
|
+
'dojo/_base/declare',
|
|
3
|
+
'../../core/_Module',
|
|
4
|
+
'../../support/QuickFilter',
|
|
5
|
+
'../Bar'
|
|
6
|
+
], function(declare, _Module, QuickFilter){
|
|
7
|
+
|
|
8
|
+
/*=====
|
|
9
|
+
return declare(_Module, {
|
|
10
|
+
// summary:
|
|
11
|
+
// Directly show gridx/support/QuickFilter in gridx/modules/Bar at the top/right position.
|
|
12
|
+
// description:
|
|
13
|
+
// This module is only for convenience. For other positions or more configurations, please use gridx/modules/Bar directly.
|
|
14
|
+
// This module depends on "bar" and "filter" modules.
|
|
15
|
+
});
|
|
16
|
+
=====*/
|
|
17
|
+
|
|
18
|
+
return declare(_Module, {
|
|
19
|
+
name: 'quickFilter',
|
|
20
|
+
|
|
21
|
+
required: ['bar', 'filter'],
|
|
22
|
+
|
|
23
|
+
preload: function(){
|
|
24
|
+
this.grid.bar.defs.push({
|
|
25
|
+
bar: 'top',
|
|
26
|
+
row: 0,
|
|
27
|
+
col: 3,
|
|
28
|
+
pluginClass: QuickFilter,
|
|
29
|
+
className: 'gridxBarQuickFilter'
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
});
|