gridx-rails 1.2.1 → 1.3.0.pre.alpha
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +9 -9
- data/app/assets/images/gridx/resources/images/headershadow.png +0 -0
- data/app/assets/images/gridx/resources/images/rowback.png +0 -0
- data/app/assets/images/gridx/resources/images/sprite.png +0 -0
- data/app/assets/javascripts/gridx/Grid.js +20 -3
- data/app/assets/javascripts/gridx/allModules.js +18 -4
- data/app/assets/javascripts/gridx/core/Core.js +36 -6
- data/app/assets/javascripts/gridx/core/model/Model.js +6 -5
- data/app/assets/javascripts/gridx/core/model/cache/Async.js +9 -7
- data/app/assets/javascripts/gridx/core/model/cache/Sync.js +414 -12
- data/app/assets/javascripts/gridx/core/model/extensions/Mark.js +14 -20
- data/app/assets/javascripts/gridx/core/model/extensions/Modify.js +3 -10
- data/app/assets/javascripts/gridx/modules/AutoPagedBody.js +100 -0
- data/app/assets/javascripts/gridx/modules/AutoScroll.js +92 -23
- data/app/assets/javascripts/gridx/modules/Bar.js +14 -1
- data/app/assets/javascripts/gridx/modules/Body.js +64 -29
- data/app/assets/javascripts/gridx/modules/CellWidget.js +5 -2
- data/app/assets/javascripts/gridx/modules/ColumnLock.js +1 -2
- data/app/assets/javascripts/gridx/modules/ColumnWidth.js +4 -1
- data/app/assets/javascripts/gridx/modules/Dod.js +216 -12
- data/app/assets/javascripts/gridx/modules/Edit.js +143 -68
- data/app/assets/javascripts/gridx/modules/ExpandableColumn.js +292 -0
- data/app/assets/javascripts/gridx/modules/Filter.js +14 -0
- data/app/assets/javascripts/gridx/modules/Focus.js +9 -3
- data/app/assets/javascripts/gridx/modules/Header.js +22 -12
- data/app/assets/javascripts/gridx/modules/HeaderRegions.js +23 -8
- data/app/assets/javascripts/gridx/modules/IndirectSelect.js +6 -7
- data/app/assets/javascripts/gridx/modules/IndirectSelectColumn.js +1 -1
- data/app/assets/javascripts/gridx/modules/Layer.js +358 -0
- data/app/assets/javascripts/gridx/modules/NestedSort.js +8 -10
- data/app/assets/javascripts/gridx/modules/PagedBody.js +22 -323
- data/app/assets/javascripts/gridx/modules/Puller.js +113 -0
- data/app/assets/javascripts/gridx/modules/RowHeader.js +7 -6
- data/app/assets/javascripts/gridx/modules/RowLock.js +49 -19
- data/app/assets/javascripts/gridx/modules/SlantedHeader.js +46 -0
- data/app/assets/javascripts/gridx/modules/Sort.js +417 -0
- data/app/assets/javascripts/gridx/modules/StructureSwitch.js +143 -0
- data/app/assets/javascripts/gridx/modules/SummaryBar.js +6 -1
- data/app/assets/javascripts/gridx/modules/TouchVScroller.js +36 -13
- data/app/assets/javascripts/gridx/modules/Tree.js +6 -8
- data/app/assets/javascripts/gridx/modules/VScroller.js +1 -1
- data/app/assets/javascripts/gridx/modules/View.js +25 -18
- data/app/assets/javascripts/gridx/modules/VirtualVScroller.js +23 -11
- data/app/assets/javascripts/gridx/modules/_PagedBodyMixin.js +351 -0
- data/app/assets/javascripts/gridx/modules/dnd/Avatar.js +1 -1
- data/app/assets/javascripts/gridx/modules/dnd/_Dnd.js +1 -0
- data/app/assets/javascripts/gridx/modules/extendedSelect/Row.js +8 -5
- data/app/assets/javascripts/gridx/modules/filter/FilterBar.js +24 -17
- data/app/assets/javascripts/gridx/modules/filter/FilterConfirmDialog.js +3 -1
- data/app/assets/javascripts/gridx/modules/filter/FilterDialog.js +2 -2
- data/app/assets/javascripts/gridx/modules/filter/FilterPane.js +4 -5
- data/app/assets/javascripts/gridx/modules/filter/FilterTooltip.js +1 -1
- data/app/assets/javascripts/gridx/modules/filter/QuickFilter.js +32 -9
- data/app/assets/javascripts/gridx/modules/pagination/_PaginationBarBase.js +4 -1
- data/app/assets/javascripts/gridx/modules/select/Row.js +8 -4
- data/app/assets/javascripts/gridx/nls/ar/{FilterBar.js → gridx.js} +77 -5
- data/app/assets/javascripts/gridx/nls/bg/{FilterBar.js → gridx.js} +71 -5
- data/app/assets/javascripts/gridx/nls/ca/{FilterBar.js → gridx.js} +71 -5
- data/app/assets/javascripts/gridx/nls/cs/{FilterBar.js → gridx.js} +77 -5
- data/app/assets/javascripts/gridx/nls/da/{FilterBar.js → gridx.js} +77 -5
- data/app/assets/javascripts/gridx/nls/de/{FilterBar.js → gridx.js} +77 -5
- data/app/assets/javascripts/gridx/nls/el/{FilterBar.js → gridx.js} +77 -5
- data/app/assets/javascripts/gridx/nls/es/{FilterBar.js → gridx.js} +71 -5
- data/app/assets/javascripts/gridx/nls/fi/{FilterBar.js → gridx.js} +77 -5
- data/app/assets/javascripts/gridx/nls/fr/{FilterBar.js → gridx.js} +77 -5
- data/app/assets/javascripts/gridx/nls/{FilterBar.js → gridx.js} +80 -4
- data/app/assets/javascripts/gridx/nls/he/{FilterBar.js → gridx.js} +77 -5
- data/app/assets/javascripts/gridx/nls/hr/{FilterBar.js → gridx.js} +77 -5
- data/app/assets/javascripts/gridx/nls/hu/{FilterBar.js → gridx.js} +77 -5
- data/app/assets/javascripts/gridx/nls/it/{FilterBar.js → gridx.js} +77 -5
- data/app/assets/javascripts/gridx/nls/ja/{FilterBar.js → gridx.js} +77 -5
- data/app/assets/javascripts/gridx/nls/kk/{FilterBar.js → gridx.js} +76 -5
- data/app/assets/javascripts/gridx/nls/ko/{FilterBar.js → gridx.js} +81 -5
- data/app/assets/javascripts/gridx/nls/nb/{FilterBar.js → gridx.js} +77 -5
- data/app/assets/javascripts/gridx/nls/nl/{FilterBar.js → gridx.js} +77 -5
- data/app/assets/javascripts/gridx/nls/pl/{FilterBar.js → gridx.js} +77 -5
- data/app/assets/javascripts/gridx/nls/pt/{FilterBar.js → gridx.js} +71 -5
- data/app/assets/javascripts/gridx/nls/pt-pt/{FilterBar.js → gridx.js} +71 -5
- data/app/assets/javascripts/gridx/nls/ro/{FilterBar.js → gridx.js} +71 -5
- data/app/assets/javascripts/gridx/nls/ru/{FilterBar.js → gridx.js} +77 -5
- data/app/assets/javascripts/gridx/nls/sk/{FilterBar.js → gridx.js} +71 -5
- data/app/assets/javascripts/gridx/nls/sl/{FilterBar.js → gridx.js} +77 -5
- data/app/assets/javascripts/gridx/nls/sv/{FilterBar.js → gridx.js} +77 -5
- data/app/assets/javascripts/gridx/nls/th/{FilterBar.js → gridx.js} +77 -5
- data/app/assets/javascripts/gridx/nls/tr/{FilterBar.js → gridx.js} +77 -5
- data/app/assets/javascripts/gridx/nls/uk/{FilterBar.js → gridx.js} +71 -5
- data/app/assets/javascripts/gridx/nls/zh/{FilterBar.js → gridx.js} +77 -5
- data/app/assets/javascripts/gridx/nls/zh-tw/{FilterBar.js → gridx.js} +77 -5
- data/app/assets/javascripts/gridx/nls/zz-ZZ/gridx.js +173 -0
- data/app/assets/javascripts/gridx/support/DropDownPager.js +3 -5
- data/app/assets/javascripts/gridx/support/DropDownSizer.js +3 -5
- data/app/assets/javascripts/gridx/support/GotoPagePane.js +3 -5
- data/app/assets/javascripts/gridx/support/QuickFilter.js +3 -5
- data/app/assets/javascripts/gridx/support/Summary.js +32 -10
- data/app/assets/javascripts/gridx/support/_LinkPageBase.js +3 -5
- data/app/assets/javascripts/gridx/support/query.js +47 -0
- data/app/assets/javascripts/gridx/templates/FilterBar.html +1 -1
- data/app/assets/javascripts/gridx/templates/QuickFilter.html +3 -3
- data/app/assets/stylesheets/gridx/resources/Gridx.css +1 -10
- data/app/assets/stylesheets/gridx/resources/claro/Gridx.css +1 -16
- data/app/assets/stylesheets/gridx/resources/slantedHeader.css +90 -0
- data/lib/gridx-rails/version.rb +1 -1
- data/lib/tasks/gridx-rails_tasks.rake +1 -1
- data/test/dummy/log/test.log +5 -0
- metadata +52 -260
- 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/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/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/javascripts/gridx/core/model/cache/_Cache.js +0 -403
- data/app/assets/javascripts/gridx/core/util.js +0 -13
- data/app/assets/javascripts/gridx/modules/Printer.js +0 -49
- data/app/assets/javascripts/gridx/modules/TitleBar.js +0 -51
- data/app/assets/javascripts/gridx/modules/barPlugins/DropDownPager.js +0 -16
- data/app/assets/javascripts/gridx/modules/barPlugins/DropDownSizer.js +0 -16
- data/app/assets/javascripts/gridx/modules/barPlugins/GotoPageButton.js +0 -16
- data/app/assets/javascripts/gridx/modules/barPlugins/LinkPager.js +0 -16
- data/app/assets/javascripts/gridx/modules/barPlugins/LinkSizer.js +0 -16
- data/app/assets/javascripts/gridx/modules/barPlugins/Summary.js +0 -16
- data/app/assets/javascripts/gridx/modules/exporter/CSV.js +0 -43
- data/app/assets/javascripts/gridx/modules/exporter/Exporter.js +0 -34
- data/app/assets/javascripts/gridx/modules/exporter/Table.js +0 -42
- data/app/assets/javascripts/gridx/modules/filter/Filter.js +0 -16
- data/app/assets/javascripts/gridx/modules/pagination/Pagination.js +0 -16
- data/app/assets/javascripts/gridx/nls/Body.js +0 -47
- data/app/assets/javascripts/gridx/nls/NestedSort.js +0 -45
- data/app/assets/javascripts/gridx/nls/PaginationBar.js +0 -68
- data/app/assets/javascripts/gridx/nls/QuickFilter.js +0 -40
- data/app/assets/javascripts/gridx/nls/SummaryBar.js +0 -38
- data/app/assets/javascripts/gridx/nls/ar/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/ar/NestedSort.js +0 -11
- data/app/assets/javascripts/gridx/nls/ar/PaginationBar.js +0 -34
- data/app/assets/javascripts/gridx/nls/ar/QuickFilter.js +0 -7
- data/app/assets/javascripts/gridx/nls/ar/SummaryBar.js +0 -5
- data/app/assets/javascripts/gridx/nls/bg/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/bg/NestedSort.js +0 -12
- data/app/assets/javascripts/gridx/nls/bg/PaginationBar.js +0 -28
- data/app/assets/javascripts/gridx/nls/bg/QuickFilter.js +0 -8
- data/app/assets/javascripts/gridx/nls/bg/SummaryBar.js +0 -6
- data/app/assets/javascripts/gridx/nls/ca/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/ca/NestedSort.js +0 -13
- data/app/assets/javascripts/gridx/nls/ca/PaginationBar.js +0 -30
- data/app/assets/javascripts/gridx/nls/ca/QuickFilter.js +0 -9
- data/app/assets/javascripts/gridx/nls/ca/SummaryBar.js +0 -7
- data/app/assets/javascripts/gridx/nls/cs/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/cs/NestedSort.js +0 -11
- data/app/assets/javascripts/gridx/nls/cs/PaginationBar.js +0 -34
- data/app/assets/javascripts/gridx/nls/cs/QuickFilter.js +0 -7
- data/app/assets/javascripts/gridx/nls/cs/SummaryBar.js +0 -5
- data/app/assets/javascripts/gridx/nls/da/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/da/NestedSort.js +0 -11
- data/app/assets/javascripts/gridx/nls/da/PaginationBar.js +0 -34
- data/app/assets/javascripts/gridx/nls/da/QuickFilter.js +0 -7
- data/app/assets/javascripts/gridx/nls/da/SummaryBar.js +0 -5
- data/app/assets/javascripts/gridx/nls/de/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/de/NestedSort.js +0 -11
- data/app/assets/javascripts/gridx/nls/de/PaginationBar.js +0 -34
- data/app/assets/javascripts/gridx/nls/de/QuickFilter.js +0 -7
- data/app/assets/javascripts/gridx/nls/de/SummaryBar.js +0 -5
- data/app/assets/javascripts/gridx/nls/el/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/el/NestedSort.js +0 -11
- data/app/assets/javascripts/gridx/nls/el/PaginationBar.js +0 -34
- data/app/assets/javascripts/gridx/nls/el/QuickFilter.js +0 -7
- data/app/assets/javascripts/gridx/nls/el/SummaryBar.js +0 -5
- data/app/assets/javascripts/gridx/nls/es/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/es/NestedSort.js +0 -13
- data/app/assets/javascripts/gridx/nls/es/PaginationBar.js +0 -30
- data/app/assets/javascripts/gridx/nls/es/QuickFilter.js +0 -9
- data/app/assets/javascripts/gridx/nls/es/SummaryBar.js +0 -7
- data/app/assets/javascripts/gridx/nls/fi/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/fi/NestedSort.js +0 -11
- data/app/assets/javascripts/gridx/nls/fi/PaginationBar.js +0 -34
- data/app/assets/javascripts/gridx/nls/fi/QuickFilter.js +0 -7
- data/app/assets/javascripts/gridx/nls/fi/SummaryBar.js +0 -5
- data/app/assets/javascripts/gridx/nls/fr/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/fr/NestedSort.js +0 -11
- data/app/assets/javascripts/gridx/nls/fr/PaginationBar.js +0 -34
- data/app/assets/javascripts/gridx/nls/fr/QuickFilter.js +0 -7
- data/app/assets/javascripts/gridx/nls/fr/SummaryBar.js +0 -5
- data/app/assets/javascripts/gridx/nls/he/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/he/NestedSort.js +0 -11
- data/app/assets/javascripts/gridx/nls/he/PaginationBar.js +0 -34
- data/app/assets/javascripts/gridx/nls/he/QuickFilter.js +0 -6
- data/app/assets/javascripts/gridx/nls/he/SummaryBar.js +0 -5
- data/app/assets/javascripts/gridx/nls/hr/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/hr/NestedSort.js +0 -11
- data/app/assets/javascripts/gridx/nls/hr/PaginationBar.js +0 -34
- data/app/assets/javascripts/gridx/nls/hr/QuickFilter.js +0 -7
- data/app/assets/javascripts/gridx/nls/hr/SummaryBar.js +0 -5
- data/app/assets/javascripts/gridx/nls/hu/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/hu/NestedSort.js +0 -11
- data/app/assets/javascripts/gridx/nls/hu/PaginationBar.js +0 -33
- data/app/assets/javascripts/gridx/nls/hu/QuickFilter.js +0 -7
- data/app/assets/javascripts/gridx/nls/hu/SummaryBar.js +0 -5
- data/app/assets/javascripts/gridx/nls/it/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/it/NestedSort.js +0 -11
- data/app/assets/javascripts/gridx/nls/it/PaginationBar.js +0 -34
- data/app/assets/javascripts/gridx/nls/it/QuickFilter.js +0 -7
- data/app/assets/javascripts/gridx/nls/it/SummaryBar.js +0 -5
- data/app/assets/javascripts/gridx/nls/ja/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/ja/NestedSort.js +0 -11
- data/app/assets/javascripts/gridx/nls/ja/PaginationBar.js +0 -34
- data/app/assets/javascripts/gridx/nls/ja/QuickFilter.js +0 -7
- data/app/assets/javascripts/gridx/nls/ja/SummaryBar.js +0 -5
- data/app/assets/javascripts/gridx/nls/kk/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/kk/NestedSort.js +0 -13
- data/app/assets/javascripts/gridx/nls/kk/PaginationBar.js +0 -30
- data/app/assets/javascripts/gridx/nls/kk/QuickFilter.js +0 -9
- data/app/assets/javascripts/gridx/nls/kk/SummaryBar.js +0 -7
- data/app/assets/javascripts/gridx/nls/ko/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/ko/NestedSort.js +0 -11
- data/app/assets/javascripts/gridx/nls/ko/PaginationBar.js +0 -34
- data/app/assets/javascripts/gridx/nls/ko/QuickFilter.js +0 -7
- data/app/assets/javascripts/gridx/nls/ko/SummaryBar.js +0 -5
- data/app/assets/javascripts/gridx/nls/nb/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/nb/NestedSort.js +0 -11
- data/app/assets/javascripts/gridx/nls/nb/PaginationBar.js +0 -34
- data/app/assets/javascripts/gridx/nls/nb/QuickFilter.js +0 -7
- data/app/assets/javascripts/gridx/nls/nb/SummaryBar.js +0 -5
- data/app/assets/javascripts/gridx/nls/nl/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/nl/NestedSort.js +0 -11
- data/app/assets/javascripts/gridx/nls/nl/PaginationBar.js +0 -34
- data/app/assets/javascripts/gridx/nls/nl/QuickFilter.js +0 -7
- data/app/assets/javascripts/gridx/nls/nl/SummaryBar.js +0 -5
- data/app/assets/javascripts/gridx/nls/pl/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/pl/NestedSort.js +0 -11
- data/app/assets/javascripts/gridx/nls/pl/PaginationBar.js +0 -34
- data/app/assets/javascripts/gridx/nls/pl/QuickFilter.js +0 -7
- data/app/assets/javascripts/gridx/nls/pl/SummaryBar.js +0 -5
- data/app/assets/javascripts/gridx/nls/pt/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/pt/NestedSort.js +0 -13
- data/app/assets/javascripts/gridx/nls/pt/PaginationBar.js +0 -30
- data/app/assets/javascripts/gridx/nls/pt/QuickFilter.js +0 -9
- data/app/assets/javascripts/gridx/nls/pt/SummaryBar.js +0 -7
- data/app/assets/javascripts/gridx/nls/pt-br/Body.js +0 -6
- data/app/assets/javascripts/gridx/nls/pt-br/FilterBar.js +0 -89
- data/app/assets/javascripts/gridx/nls/pt-br/NestedSort.js +0 -11
- data/app/assets/javascripts/gridx/nls/pt-br/PaginationBar.js +0 -34
- data/app/assets/javascripts/gridx/nls/pt-br/QuickFilter.js +0 -7
- data/app/assets/javascripts/gridx/nls/pt-br/SummaryBar.js +0 -5
- data/app/assets/javascripts/gridx/nls/pt-pt/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/pt-pt/NestedSort.js +0 -13
- data/app/assets/javascripts/gridx/nls/pt-pt/PaginationBar.js +0 -30
- data/app/assets/javascripts/gridx/nls/pt-pt/QuickFilter.js +0 -9
- data/app/assets/javascripts/gridx/nls/pt-pt/SummaryBar.js +0 -7
- data/app/assets/javascripts/gridx/nls/ro/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/ro/NestedSort.js +0 -13
- data/app/assets/javascripts/gridx/nls/ro/PaginationBar.js +0 -30
- data/app/assets/javascripts/gridx/nls/ro/QuickFilter.js +0 -9
- data/app/assets/javascripts/gridx/nls/ro/SummaryBar.js +0 -7
- data/app/assets/javascripts/gridx/nls/ru/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/ru/NestedSort.js +0 -11
- data/app/assets/javascripts/gridx/nls/ru/PaginationBar.js +0 -34
- data/app/assets/javascripts/gridx/nls/ru/QuickFilter.js +0 -7
- data/app/assets/javascripts/gridx/nls/ru/SummaryBar.js +0 -5
- data/app/assets/javascripts/gridx/nls/sk/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/sk/NestedSort.js +0 -13
- data/app/assets/javascripts/gridx/nls/sk/PaginationBar.js +0 -30
- data/app/assets/javascripts/gridx/nls/sk/QuickFilter.js +0 -9
- data/app/assets/javascripts/gridx/nls/sk/SummaryBar.js +0 -7
- data/app/assets/javascripts/gridx/nls/sl/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/sl/NestedSort.js +0 -11
- data/app/assets/javascripts/gridx/nls/sl/PaginationBar.js +0 -34
- data/app/assets/javascripts/gridx/nls/sl/QuickFilter.js +0 -7
- data/app/assets/javascripts/gridx/nls/sl/SummaryBar.js +0 -5
- data/app/assets/javascripts/gridx/nls/sv/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/sv/NestedSort.js +0 -11
- data/app/assets/javascripts/gridx/nls/sv/PaginationBar.js +0 -34
- data/app/assets/javascripts/gridx/nls/sv/QuickFilter.js +0 -7
- data/app/assets/javascripts/gridx/nls/sv/SummaryBar.js +0 -5
- data/app/assets/javascripts/gridx/nls/th/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/th/NestedSort.js +0 -11
- data/app/assets/javascripts/gridx/nls/th/PaginationBar.js +0 -34
- data/app/assets/javascripts/gridx/nls/th/QuickFilter.js +0 -7
- data/app/assets/javascripts/gridx/nls/th/SummaryBar.js +0 -5
- data/app/assets/javascripts/gridx/nls/tr/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/tr/NestedSort.js +0 -11
- data/app/assets/javascripts/gridx/nls/tr/PaginationBar.js +0 -34
- data/app/assets/javascripts/gridx/nls/tr/QuickFilter.js +0 -7
- data/app/assets/javascripts/gridx/nls/tr/SummaryBar.js +0 -5
- data/app/assets/javascripts/gridx/nls/uk/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/uk/NestedSort.js +0 -12
- data/app/assets/javascripts/gridx/nls/uk/PaginationBar.js +0 -28
- data/app/assets/javascripts/gridx/nls/uk/QuickFilter.js +0 -8
- data/app/assets/javascripts/gridx/nls/uk/SummaryBar.js +0 -6
- data/app/assets/javascripts/gridx/nls/zh/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/zh/NestedSort.js +0 -11
- data/app/assets/javascripts/gridx/nls/zh/PaginationBar.js +0 -34
- data/app/assets/javascripts/gridx/nls/zh/QuickFilter.js +0 -7
- data/app/assets/javascripts/gridx/nls/zh/SummaryBar.js +0 -5
- data/app/assets/javascripts/gridx/nls/zh-tw/Body.js +0 -11
- data/app/assets/javascripts/gridx/nls/zh-tw/NestedSort.js +0 -11
- data/app/assets/javascripts/gridx/nls/zh-tw/PaginationBar.js +0 -34
- data/app/assets/javascripts/gridx/nls/zh-tw/QuickFilter.js +0 -7
- data/app/assets/javascripts/gridx/nls/zh-tw/SummaryBar.js +0 -5
- data/app/assets/stylesheets/gridx/resources/Dod.css +0 -39
- data/app/assets/stylesheets/gridx/resources/Gridx_rtl.css +0 -5
- data/app/assets/stylesheets/gridx/resources/Tree.css +0 -46
- data/app/assets/stylesheets/gridx/resources/Tree_rtl.css +0 -4
- data/app/assets/stylesheets/gridx/resources/bar.css +0 -24
- data/app/assets/stylesheets/gridx/resources/basic.css +0 -482
- data/app/assets/stylesheets/gridx/resources/basic_rtl.css +0 -37
- data/app/assets/stylesheets/gridx/resources/claro/Gridx_rtl.css +0 -7
- data/app/assets/stylesheets/gridx/resources/claro/basic.css +0 -109
- data/app/assets/stylesheets/gridx/resources/claro/basic_rtl.css +0 -21
- data/app/assets/stylesheets/gridx/resources/claro/filter.css +0 -47
- data/app/assets/stylesheets/gridx/resources/claro/lock.css +0 -19
- data/app/assets/stylesheets/gridx/resources/claro/pagination.css +0 -33
- data/app/assets/stylesheets/gridx/resources/claro/select.css +0 -20
- data/app/assets/stylesheets/gridx/resources/dnd.css +0 -108
- data/app/assets/stylesheets/gridx/resources/filter.css +0 -321
- data/app/assets/stylesheets/gridx/resources/filter_rtl.css +0 -38
- data/app/assets/stylesheets/gridx/resources/lock.css +0 -20
- data/app/assets/stylesheets/gridx/resources/pagination.css +0 -142
- data/app/assets/stylesheets/gridx/resources/pagination_rtl.css +0 -54
- data/app/assets/stylesheets/gridx/resources/select.css +0 -39
- data/app/assets/stylesheets/gridx/resources/sort.css +0 -154
- data/app/assets/stylesheets/gridx/resources/sort_rtl.css +0 -51
@@ -0,0 +1,46 @@
|
|
1
|
+
define([
|
2
|
+
"dojo/_base/declare",
|
3
|
+
"dojo/_base/array",
|
4
|
+
"dojo/_base/lang",
|
5
|
+
"dojo/_base/event",
|
6
|
+
"dojo/query",
|
7
|
+
"dojo/string",
|
8
|
+
"dojo/dom-class",
|
9
|
+
"dojo/dom-construct",
|
10
|
+
"dojo/keys",
|
11
|
+
"../core/_Module",
|
12
|
+
"./GroupHeader"
|
13
|
+
], function(declare, array, lang, event, query, string, domClass, domConstruct, keys, _Module, Sort, nls){
|
14
|
+
|
15
|
+
/*=====
|
16
|
+
return declare(_Module, {
|
17
|
+
// summary:
|
18
|
+
// module name: slantedheader.
|
19
|
+
// Slant headers including group headers.
|
20
|
+
|
21
|
+
|
22
|
+
});
|
23
|
+
=====*/
|
24
|
+
|
25
|
+
return declare(_Module, {
|
26
|
+
name: 'slantedheader',
|
27
|
+
|
28
|
+
_actionAreaHolder: null,
|
29
|
+
|
30
|
+
required: ['header'],
|
31
|
+
|
32
|
+
load: function(args, deferStartup){
|
33
|
+
domClass.add(this.grid.domNode, 'gridxSlantedHeader');
|
34
|
+
|
35
|
+
//Skew the header node, and use translate to align columns
|
36
|
+
var n = this.grid.header.domNode;
|
37
|
+
var headerHeight = n.offsetHeight;
|
38
|
+
var translateX = headerHeight/2 - 1; //TODO: 1 is the top border width
|
39
|
+
n.style.transform = n.style.msTransform = n.style.mozTransform
|
40
|
+
= n.style.webkitTransform = 'translate(' + translateX
|
41
|
+
+ 'px, 0px) skew(-45deg,0deg)';
|
42
|
+
|
43
|
+
this.loaded.callback();
|
44
|
+
}
|
45
|
+
});
|
46
|
+
});
|
@@ -0,0 +1,417 @@
|
|
1
|
+
define([
|
2
|
+
/*====="gridx/core/Column",=====*/
|
3
|
+
"dojo/_base/declare",
|
4
|
+
"dojo/_base/array",
|
5
|
+
"dojo/query",
|
6
|
+
"dojo/_base/event",
|
7
|
+
"dojo/_base/sniff",
|
8
|
+
"dojo/string",
|
9
|
+
"dojo/keys",
|
10
|
+
"dojo/dom",
|
11
|
+
"dojo/dom-class",
|
12
|
+
"../core/model/extensions/Sort",
|
13
|
+
"../core/_Module"
|
14
|
+
], function(/*=====Column, =====*/declare, array, query, event, has, string, keys, dom, domClass, Sort, _Module){
|
15
|
+
|
16
|
+
/*=====
|
17
|
+
Column.sort = function(isDescending, isAdd){
|
18
|
+
// summary:
|
19
|
+
//
|
20
|
+
};
|
21
|
+
Column.isSorted = function(){
|
22
|
+
// summary:
|
23
|
+
//
|
24
|
+
};
|
25
|
+
Column.clearSort = function(){
|
26
|
+
// summary:
|
27
|
+
//
|
28
|
+
};
|
29
|
+
Column.isSortable = function(){
|
30
|
+
// summary:
|
31
|
+
//
|
32
|
+
};
|
33
|
+
Column.setSortable = function(sortable){
|
34
|
+
// summary:
|
35
|
+
//
|
36
|
+
};
|
37
|
+
|
38
|
+
return declare(_Module, {
|
39
|
+
// summary:
|
40
|
+
// module name: sort.
|
41
|
+
// A sort module suitable for both nested sort and single sort.
|
42
|
+
|
43
|
+
// initialOrder: Object[]
|
44
|
+
// The initial sort order when grid is created.
|
45
|
+
// This is of the same format of the sort argument of the store fetch function.
|
46
|
+
initialOrder: null,
|
47
|
+
|
48
|
+
// nested: Boolean
|
49
|
+
// Whether nested sort is allowed.
|
50
|
+
// If true, CTRL+click does nested sort.
|
51
|
+
// If false, only single sort.
|
52
|
+
nested: true,
|
53
|
+
|
54
|
+
sort: function(sortData){
|
55
|
+
// summary:
|
56
|
+
//
|
57
|
+
},
|
58
|
+
|
59
|
+
isSorted: function(colId){
|
60
|
+
// summary:
|
61
|
+
//
|
62
|
+
},
|
63
|
+
|
64
|
+
clear: function(){
|
65
|
+
// summary:
|
66
|
+
//
|
67
|
+
},
|
68
|
+
|
69
|
+
getSortData: function(){
|
70
|
+
// summary:
|
71
|
+
//
|
72
|
+
}
|
73
|
+
});
|
74
|
+
=====*/
|
75
|
+
|
76
|
+
return _Module.register(
|
77
|
+
declare(_Module, {
|
78
|
+
name: 'sort',
|
79
|
+
|
80
|
+
forced: ['header'],
|
81
|
+
|
82
|
+
modelExtensions: [Sort],
|
83
|
+
|
84
|
+
constructor: function(){
|
85
|
+
this._sortData = [];
|
86
|
+
},
|
87
|
+
|
88
|
+
preload: function(){
|
89
|
+
var t = this,
|
90
|
+
g = t.grid, sort;
|
91
|
+
domClass.add(g.domNode, 'gridxSort');
|
92
|
+
t.aspect(g, 'onHeaderCellClick', '_onClick');
|
93
|
+
t.aspect(g, 'onHeaderCellMouseOver', 'reLayout', g.vLayout);
|
94
|
+
t.aspect(g, 'onHeaderCellMouseOut', 'reLayout', g.vLayout);
|
95
|
+
t.aspect(g.header, 'onRender', '_update');
|
96
|
+
t.connect(g, 'onHeaderCellTouchStart', function(evt){
|
97
|
+
query('.gridxHeaderCellTouch', g.header.domNode).removeClass('gridxHeaderCellTouch');
|
98
|
+
domClass.add(evt.headerCellNode, 'gridxHeaderCellTouch');
|
99
|
+
});
|
100
|
+
t.connect(g, 'onHeaderCellTouchEnd', function(evt){
|
101
|
+
domClass.remove(evt.headerCellNode, 'gridxHeaderCellTouch');
|
102
|
+
});
|
103
|
+
//persistence support
|
104
|
+
if(g.persist){
|
105
|
+
sort = g.persist.registerAndLoad('sort', function(){
|
106
|
+
return t._sortData;
|
107
|
+
});
|
108
|
+
}
|
109
|
+
//Presort...
|
110
|
+
sort = sort || t.arg('initialOrder');
|
111
|
+
if(sort && sort.length){
|
112
|
+
t._sortData = sort;
|
113
|
+
//sort here so the body can render correctly.
|
114
|
+
t.model.sort(sort);
|
115
|
+
}
|
116
|
+
},
|
117
|
+
|
118
|
+
load: function(){
|
119
|
+
var t = this,
|
120
|
+
g = t.grid;
|
121
|
+
t._update();
|
122
|
+
if(has('ff')){
|
123
|
+
//Only in FF, there will be a selection border on the header node when clicking it holding CTRL.
|
124
|
+
dom.setSelectable(g.header.domNode, false);
|
125
|
+
}
|
126
|
+
t._initFocus();
|
127
|
+
t.loaded.callback();
|
128
|
+
},
|
129
|
+
|
130
|
+
columnMixin: {
|
131
|
+
sort: function(isDescending, isAdd){
|
132
|
+
var sort = this.grid.sort;
|
133
|
+
sort._prepareSortData(this.id, isAdd);
|
134
|
+
return sort.sort(sort._sortData);
|
135
|
+
},
|
136
|
+
|
137
|
+
isSorted: function(){
|
138
|
+
return this.grid.sort.isSorted(this.id);
|
139
|
+
},
|
140
|
+
|
141
|
+
clearSort: function(){
|
142
|
+
this.grid.sort.clear();
|
143
|
+
return this;
|
144
|
+
},
|
145
|
+
|
146
|
+
isSortable: function(){
|
147
|
+
var col = this.grid._columnsById[this.id];
|
148
|
+
return col.sortable || col.sortable === undefined;
|
149
|
+
},
|
150
|
+
|
151
|
+
setSortable: function(isSortable){
|
152
|
+
this.grid._columnsById[this.id].sortable = isSortable;
|
153
|
+
return this;
|
154
|
+
}
|
155
|
+
},
|
156
|
+
|
157
|
+
//Public--------------------------------------------------------------
|
158
|
+
nested: true,
|
159
|
+
|
160
|
+
sort: function(sortData){
|
161
|
+
//A column is always sortable programmatically. The sortable attribute is only meaningful for UI
|
162
|
+
this._sortData = sortData || [];
|
163
|
+
this.model.sort(sortData);
|
164
|
+
this._updateHeader();
|
165
|
+
return this.grid.body.refresh();
|
166
|
+
},
|
167
|
+
|
168
|
+
isSorted: function(colId){
|
169
|
+
for(var i = this._sortData.length - 1; i >= 0; --i){
|
170
|
+
var s = this._sortData[i];
|
171
|
+
if(s.colId === colId){
|
172
|
+
return s.decending ? -1 : 1;
|
173
|
+
}
|
174
|
+
}
|
175
|
+
return 0;
|
176
|
+
},
|
177
|
+
|
178
|
+
clear: function(){
|
179
|
+
this.sort();
|
180
|
+
},
|
181
|
+
|
182
|
+
getSortData: function(){
|
183
|
+
return this._sortData;
|
184
|
+
},
|
185
|
+
|
186
|
+
//Private--------------------------------------------------------------
|
187
|
+
_sortData: null,
|
188
|
+
|
189
|
+
_onClick: function(e){
|
190
|
+
event.stop(e);
|
191
|
+
this._sort(e.columnId, domClass.contains(e.target, 'gridxArrowButtonNode'), this.grid._isCtrlKey(e));
|
192
|
+
},
|
193
|
+
|
194
|
+
_sort: function(id, isSortArrow, isNested){
|
195
|
+
var g = this.grid;
|
196
|
+
this._focusHeaderId = id;
|
197
|
+
this._focusSortArrow = isSortArrow;
|
198
|
+
if(g.column(id, 1).isSortable() && (isSortArrow || !g.select || !g.select.column)){
|
199
|
+
this._prepareSortData(id, isNested);
|
200
|
+
this.sort(this._sortData);
|
201
|
+
}
|
202
|
+
},
|
203
|
+
|
204
|
+
_prepareSortData: function(colId, isAdd){
|
205
|
+
var t = this,
|
206
|
+
oneway = true,
|
207
|
+
desc = false,
|
208
|
+
sortable = t.grid._columnsById[colId].sortable;
|
209
|
+
isAdd = t.arg('nested') && isAdd;
|
210
|
+
if(sortable == 'descend'){
|
211
|
+
desc = true;
|
212
|
+
}else if(sortable != 'ascend'){
|
213
|
+
oneway = false;
|
214
|
+
}
|
215
|
+
for(var s, i = t._sortData.length - 1; i >= 0; --i, s = 0){
|
216
|
+
s = t._sortData[i];
|
217
|
+
if(s.colId === colId){
|
218
|
+
s.descending = oneway ? desc : !s.descending;
|
219
|
+
break;
|
220
|
+
}
|
221
|
+
}
|
222
|
+
if(!s){
|
223
|
+
s = {
|
224
|
+
colId: colId,
|
225
|
+
descending: oneway && desc
|
226
|
+
};
|
227
|
+
t._sortData.push(s);
|
228
|
+
}
|
229
|
+
if(!isAdd){
|
230
|
+
t._sortData = [s];
|
231
|
+
}
|
232
|
+
},
|
233
|
+
|
234
|
+
_getSortModeCls: function(col){
|
235
|
+
return {
|
236
|
+
ascend: 'gridxSortAscendOnly',
|
237
|
+
descend: 'gridxSortDescendOnly'
|
238
|
+
}[col.isSortable()] || '';
|
239
|
+
},
|
240
|
+
|
241
|
+
_initHeader: function(col){
|
242
|
+
var n = col.headerNode();
|
243
|
+
n.innerHTML = ["<div class='gridxSortNode'><div role='presentation' tabindex='0' class='gridxArrowButtonNode ",
|
244
|
+
this._getSortModeCls(col),
|
245
|
+
"'></div><div class='gridxColCaption'>",
|
246
|
+
col.name(),
|
247
|
+
"</div></div>"
|
248
|
+
].join('');
|
249
|
+
n.removeAttribute('aria-sort');
|
250
|
+
this._setTitle(n, col);
|
251
|
+
},
|
252
|
+
|
253
|
+
_update: function(){
|
254
|
+
var t = this,
|
255
|
+
g = t.grid;
|
256
|
+
query('.gridxCell', g.header.domNode).forEach(function(node){
|
257
|
+
var col = g.column(node.getAttribute('colid'), 1);
|
258
|
+
if(col.isSortable()){
|
259
|
+
t._initHeader(col);
|
260
|
+
}
|
261
|
+
t._setTitle(node, col);
|
262
|
+
});
|
263
|
+
t._updateHeader();
|
264
|
+
},
|
265
|
+
|
266
|
+
_setTitle: function(headerCellNode, col){
|
267
|
+
if(col.isSortable()){
|
268
|
+
headerCellNode.setAttribute('title', string.substitute(
|
269
|
+
this.arg('nested') ? this.grid.nls.helpMsg : this.grid.nls.singleHelpMsg,
|
270
|
+
//If column name includes HTML tags, can provide tooltip instead.
|
271
|
+
[col.def().tooltip || col.name()]));
|
272
|
+
}
|
273
|
+
},
|
274
|
+
|
275
|
+
_updateHeader: function(){
|
276
|
+
var g = this.grid;
|
277
|
+
query('[aria-sort]', g.header.domNode).forEach(function(n){
|
278
|
+
this._initHeader(g.column(n.getAttribute('colid'), 1));
|
279
|
+
}, this);
|
280
|
+
var sortData = array.filter(this._sortData, function(s){
|
281
|
+
return g._columnsById[s.colId];
|
282
|
+
});
|
283
|
+
for(var i = 0, len = sortData.length; i < len; ++i){
|
284
|
+
var s = sortData[i],
|
285
|
+
col = g.column(s.colId, 1),
|
286
|
+
n = col.headerNode();
|
287
|
+
n.innerHTML = ["<div class='gridxSortNode ",
|
288
|
+
(s.descending ? 'gridxSortDown' : 'gridxSortUp'),
|
289
|
+
"'><div role='presentation' tabindex='0' class='gridxArrowButtonNode ",
|
290
|
+
this._getSortModeCls(col), "'>",
|
291
|
+
"<div class='gridxArrowButtonChar'>",
|
292
|
+
(s.descending ? "▾" : "▴"),
|
293
|
+
"</div></div><div class='",
|
294
|
+
len == 1 ? "gridxSortSingle" : "gridxSortNested",
|
295
|
+
"'>", i + 1,
|
296
|
+
"</div><div class='gridxColCaption'>", col.name(),
|
297
|
+
"</div></div>"
|
298
|
+
].join('');
|
299
|
+
n.setAttribute('aria-sort', s.descending ? 'descending' : 'ascending');
|
300
|
+
//FIXME: it there any better way to set aria sort priority?
|
301
|
+
if(this.arg('nested')){
|
302
|
+
var priority = string.substitute(g.nls.priorityOrder, [i + 1]);
|
303
|
+
n.setAttribute('aria-label', (col.def().tooltip || col.name()) + ', ' + priority);
|
304
|
+
}
|
305
|
+
}
|
306
|
+
g.vLayout.reLayout();
|
307
|
+
if(g.focus && g.focus.currentArea() == 'header'){
|
308
|
+
this._focus(this._focusHeaderId);
|
309
|
+
}
|
310
|
+
},
|
311
|
+
|
312
|
+
//Keyboard support-----------------------------------------------------------------
|
313
|
+
_focusHeaderId: null,
|
314
|
+
|
315
|
+
_focusSortArrow: false,
|
316
|
+
|
317
|
+
_initFocus: function(){
|
318
|
+
var g = this.grid, focus = g.focus;
|
319
|
+
if(focus){
|
320
|
+
if(g.select && g.select.column){
|
321
|
+
focus.registerArea({
|
322
|
+
name: 'header',
|
323
|
+
priority: 0,
|
324
|
+
focusNode: g.header.domNode,
|
325
|
+
scope: this,
|
326
|
+
doFocus: this._doFocus,
|
327
|
+
onFocus: this._onFocus,
|
328
|
+
// doBlur: hitch(this, this._doBlur),
|
329
|
+
// onBlur: hitch(this, this._onBlur),
|
330
|
+
connects: [this.connect(g, 'onHeaderCellKeyPress', '_onKeyPress')]
|
331
|
+
});
|
332
|
+
}else{
|
333
|
+
this.connect(g, 'onHeaderCellKeyDown', function(evt){
|
334
|
+
if(evt.keyCode == keys.ENTER || evt.keyCode == keys.SPACE){
|
335
|
+
this._sort(evt.columnId, false, g._isCtrlKey(evt));
|
336
|
+
}
|
337
|
+
});
|
338
|
+
}
|
339
|
+
}
|
340
|
+
},
|
341
|
+
|
342
|
+
_doFocus: function(evt){
|
343
|
+
var id = this._focusHeaderId = this._focusHeaderId || this.grid._columns[0].id;
|
344
|
+
this._focus(id, evt);
|
345
|
+
return true;
|
346
|
+
},
|
347
|
+
|
348
|
+
_onFocus: function(evt){
|
349
|
+
this._focusSortArrow = false;
|
350
|
+
return true;
|
351
|
+
},
|
352
|
+
|
353
|
+
// _doBlur: function(){
|
354
|
+
// return true;
|
355
|
+
// },
|
356
|
+
|
357
|
+
// _onBlur: function(){
|
358
|
+
// return true;
|
359
|
+
// },
|
360
|
+
|
361
|
+
_onKeyPress: function(e){
|
362
|
+
switch(e.keyCode){
|
363
|
+
case keys.RIGHT_ARROW:
|
364
|
+
case keys.LEFT_ARROW:
|
365
|
+
this._moveFocus(e);
|
366
|
+
break;
|
367
|
+
case keys.ENTER:
|
368
|
+
case keys.SPACE:
|
369
|
+
this._sort(this._focusHeaderId, this._focusSortArrow, this.grid._isCtrlKey(e));
|
370
|
+
}
|
371
|
+
},
|
372
|
+
|
373
|
+
_moveFocus: function(evt){
|
374
|
+
if(this._focusHeaderId){ //Only need to move focus when we are already focusing on a column
|
375
|
+
var col, g = this.grid, dir = g.isLeftToRight() ? 1 : -1,
|
376
|
+
delta = evt.keyCode == keys.LEFT_ARROW ? -dir : dir,
|
377
|
+
focusSortArrow = this._focusSortArrow;
|
378
|
+
event.stop(evt); //Prevent scrolling the whole page.
|
379
|
+
col = g.column(this._focusHeaderId, 1);
|
380
|
+
var sortable = col.isSortable();
|
381
|
+
if(!sortable || focusSortArrow ^ (delta < 0)){
|
382
|
+
col = g.column(col.index() + delta);
|
383
|
+
}
|
384
|
+
if(col){
|
385
|
+
this._focusHeaderId = col.id;
|
386
|
+
this._focusSortArrow = col.isSortable() && (sortable || delta < 0) && !focusSortArrow;
|
387
|
+
this._focus(col.id, evt);
|
388
|
+
}
|
389
|
+
}
|
390
|
+
},
|
391
|
+
|
392
|
+
_focus: function(id, evt){
|
393
|
+
var header = this.grid.header,
|
394
|
+
headerNode = header.getHeaderNode(id);
|
395
|
+
header._focusNode(headerNode);
|
396
|
+
if(evt){
|
397
|
+
header.onMoveToHeaderCell(id, evt);
|
398
|
+
}
|
399
|
+
this._focusArrow(id);
|
400
|
+
},
|
401
|
+
|
402
|
+
_focusArrow: function(id){
|
403
|
+
var header = this.grid.header;
|
404
|
+
query('.gridxArrowButtonFocus', header.domNode).forEach(function(node){
|
405
|
+
domClass.remove(node, 'gridxArrowButtonFocus');
|
406
|
+
});
|
407
|
+
if(this._focusSortArrow){
|
408
|
+
var arrowNode = query('.gridxArrowButtonNode', header.getHeaderNode(id))[0];
|
409
|
+
if(arrowNode){
|
410
|
+
domClass.add(arrowNode, 'gridxArrowButtonFocus');
|
411
|
+
arrowNode.focus();
|
412
|
+
}
|
413
|
+
}
|
414
|
+
}
|
415
|
+
}));
|
416
|
+
});
|
417
|
+
|
@@ -0,0 +1,143 @@
|
|
1
|
+
define([
|
2
|
+
'dojo/_base/kernel',
|
3
|
+
'dojo/_base/declare',
|
4
|
+
'dojo/_base/array',
|
5
|
+
'../core/_Module'
|
6
|
+
], function(kernel, declare, array, _Module){
|
7
|
+
kernel.experimental('gridx/modules/structureSwitch');
|
8
|
+
|
9
|
+
/*=====
|
10
|
+
return declare(_Module, {
|
11
|
+
// summary:
|
12
|
+
// module name: structureSwitch.
|
13
|
+
// Switch column structure by means of hidden columns.
|
14
|
+
// description:
|
15
|
+
// All possible columns are declared on creation of gridx, but only a few of them are shown at a time.
|
16
|
+
// Column structure profiles are defined, each profile defines which columns to show.
|
17
|
+
// Switch profiles through API of this module, which is done by means of the HiddenColumns module.
|
18
|
+
// Especially suitable for orientation change on mobile device.
|
19
|
+
|
20
|
+
// default: String
|
21
|
+
// The name of the default structure profile. Should exist in the config parameter.
|
22
|
+
// If not, every column will be shown.
|
23
|
+
default: '',
|
24
|
+
|
25
|
+
// orientation: Boolean
|
26
|
+
// If true, gridx automatically checks which profile to use on every "orientationchange" event.
|
27
|
+
orientation: true,
|
28
|
+
|
29
|
+
// config: Object
|
30
|
+
// An association array to define column structure profiles.
|
31
|
+
// Key is profile name. Value is an array of column IDs.
|
32
|
+
config: {},
|
33
|
+
|
34
|
+
// condition: Object
|
35
|
+
// An association array to define trigger-conditions for every profile.
|
36
|
+
// Key is profile name (should exists in the config parameter).
|
37
|
+
// Value is a predicate function accepting grid as its parameter:
|
38
|
+
// For example:
|
39
|
+
// function(grid){
|
40
|
+
// return Math.abs(window.orientation) == 90;
|
41
|
+
// }
|
42
|
+
condition: {},
|
43
|
+
|
44
|
+
to: function(profileName){
|
45
|
+
// summary:
|
46
|
+
// Switch to a column structure indicated by the profileName.
|
47
|
+
// Returns true if switched to the target profile, false if not.
|
48
|
+
// profileName: String
|
49
|
+
// The name of the target profile.
|
50
|
+
// If set to empty string "", switch to show all columns.
|
51
|
+
// If invalid, no-op.
|
52
|
+
},
|
53
|
+
|
54
|
+
check: function(){
|
55
|
+
// summary:
|
56
|
+
// Checks every pre-defined condition predicate, if any of them returns true,
|
57
|
+
// and the corresponding profile exists, switch to that profile.
|
58
|
+
// Returns the name of the profile if found a match, null if not.
|
59
|
+
}
|
60
|
+
});
|
61
|
+
=====*/
|
62
|
+
|
63
|
+
return declare(_Module, {
|
64
|
+
name: "structureSwitch",
|
65
|
+
required: ['hiddenColumns'],
|
66
|
+
'default': '',
|
67
|
+
orientation: true,
|
68
|
+
|
69
|
+
constructor: function(){
|
70
|
+
var t = this,
|
71
|
+
config = t.arg('config') || {},
|
72
|
+
condition = t.arg('condition') || {};
|
73
|
+
if(t.arg('orientation')){
|
74
|
+
if(config.portrait){
|
75
|
+
condition.portrait = function(){
|
76
|
+
return 'orientation' in window && window.orientation === 0;
|
77
|
+
};
|
78
|
+
}
|
79
|
+
if(config.landscape){
|
80
|
+
condition.portrait = function(){
|
81
|
+
return Math.abs(window.orientation) == 90;
|
82
|
+
};
|
83
|
+
}
|
84
|
+
t.connect(window, 'orientationchange', 'check');
|
85
|
+
}
|
86
|
+
},
|
87
|
+
|
88
|
+
preload: function(){
|
89
|
+
var t = this,
|
90
|
+
dft = t.config[t.arg('default')];
|
91
|
+
if(dft){
|
92
|
+
var toHide = array.filter(array.map(t.grid._columns, function(col){
|
93
|
+
return col.id;
|
94
|
+
}), function(id){
|
95
|
+
return array.indexOf(dft, id) < 0;
|
96
|
+
});
|
97
|
+
[].push.apply(t.grid.hiddenColumns.arg('init', []), toHide);
|
98
|
+
}
|
99
|
+
},
|
100
|
+
|
101
|
+
load: function(args, startup){
|
102
|
+
var t = this;
|
103
|
+
startup.then(function(){
|
104
|
+
t.check();
|
105
|
+
t.loaded.callback();
|
106
|
+
});
|
107
|
+
},
|
108
|
+
|
109
|
+
//Public----------------------------------------------------------------------------
|
110
|
+
to: function(name){
|
111
|
+
var g = this.grid,
|
112
|
+
structure = this.config[name];
|
113
|
+
if(!structure && name === ''){
|
114
|
+
structure = array.map(g.structure, function(col){
|
115
|
+
return col.id;
|
116
|
+
});
|
117
|
+
}
|
118
|
+
if(structure){
|
119
|
+
var hiddenColumns = g.hiddenColumns;
|
120
|
+
var toHide = array.filter(g._columns, function(col){
|
121
|
+
return array.indexOf(structure, col.id) < 0;
|
122
|
+
});
|
123
|
+
var toShow = array.filter(structure, function(col){
|
124
|
+
return !g._columnsById[col.id];
|
125
|
+
});
|
126
|
+
hiddenColumns.add.apply(hiddenColumns, toHide);
|
127
|
+
hiddenColumns.remove.apply(hiddenColumns, toShow);
|
128
|
+
}
|
129
|
+
return !!structure;
|
130
|
+
},
|
131
|
+
|
132
|
+
check: function(){
|
133
|
+
var t = this;
|
134
|
+
for(var name in t.condition){
|
135
|
+
if(t.condition[name](t.grid) && t.to(name)){
|
136
|
+
t.grid.resize();
|
137
|
+
return name;
|
138
|
+
}
|
139
|
+
}
|
140
|
+
return null;
|
141
|
+
}
|
142
|
+
});
|
143
|
+
});
|
@@ -21,13 +21,18 @@ define([
|
|
21
21
|
|
22
22
|
required: ['bar'],
|
23
23
|
|
24
|
+
//message: ''
|
25
|
+
|
24
26
|
preload: function(){
|
25
27
|
this.grid.bar.defs.push({
|
26
28
|
bar: 'bottom',
|
27
29
|
row: 0,
|
28
30
|
col: 0,
|
29
31
|
pluginClass: Summary,
|
30
|
-
className: 'gridxBarSummary'
|
32
|
+
className: 'gridxBarSummary',
|
33
|
+
message: this.arg('message'),
|
34
|
+
hookPoint: this,
|
35
|
+
hookName: 'summary'
|
31
36
|
});
|
32
37
|
}
|
33
38
|
});
|