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
@@ -1,23 +1,17 @@
|
|
1
1
|
define([
|
2
2
|
"dojo/_base/declare",
|
3
|
-
"dojo/_base/lang",
|
4
3
|
"dojo/query",
|
5
|
-
"dojo/_base/array",
|
6
4
|
"dojo/dom-construct",
|
7
5
|
"dojo/dom-class",
|
8
|
-
"dojo/_base/Deferred",
|
9
|
-
"dojo/_base/sniff",
|
10
6
|
"dojo/keys",
|
11
|
-
"dijit/a11y",
|
12
7
|
"./Body",
|
13
|
-
"
|
14
|
-
|
15
|
-
"dojo/i18n!../nls/Body"
|
16
|
-
], function(declare, lang, query, array, domConstruct, domClass, Deferred, has, keys, a11y, Body, touch, i18n){
|
8
|
+
"./_PagedBodyMixin"
|
9
|
+
], function(declare, query, domConstruct, domClass, keys, Body, _PagedBodyMixin){
|
17
10
|
|
18
11
|
/*=====
|
19
12
|
return declare(Body, {
|
20
13
|
// summary:
|
14
|
+
// module name: body.
|
21
15
|
// This module provides a "load more" button (and a "load previous" button if necessary) inside grid body.
|
22
16
|
// description:
|
23
17
|
// Page size can be set to indicate how many rows to show in one page. Clicking "load more" button or
|
@@ -30,99 +24,19 @@ define([
|
|
30
24
|
// The max allowed page count. If this value > 0, when visible pages exceeds this value, some previous pages will be destroyed
|
31
25
|
// and the "load previous" button will be shown. If this value <= 0, grid will never destroy and previous pages,
|
32
26
|
// and the "load previous" button will never be shown. Default to 0.
|
33
|
-
maxPageCount: 0
|
34
|
-
|
35
|
-
// pageSize: Integer
|
36
|
-
// The row count in one page. Default to the pageSize of grid cache. If using cache has no pageSize, default to 20.
|
37
|
-
// Users can directly set grid parameter pageSize to set both the cache pageSize and the body pageSize.
|
38
|
-
// If using bodyPageSize, it'll be different from the cache page size, but that's also okay.
|
39
|
-
pageSize: 20,
|
27
|
+
maxPageCount: 0
|
40
28
|
});
|
41
29
|
=====*/
|
42
30
|
|
43
|
-
return declare(Body, {
|
31
|
+
return declare([Body, _PagedBodyMixin], {
|
44
32
|
maxPageCount: 0,
|
45
33
|
|
46
|
-
|
47
|
-
var t = this,
|
48
|
-
g = t.grid,
|
49
|
-
view = g.view;
|
50
|
-
t._nls = i18n.getLocalization('gridx', 'Body', g.lang);
|
51
|
-
view.paging = 1;
|
52
|
-
view.rootStart = 0;
|
53
|
-
view.rootCount = this.arg('pageSize', t.model._cache.pageSize || 20);
|
54
|
-
domClass.remove(t.domNode, 'gridxBodyRowHoverEffect');
|
55
|
-
t.connect(t.domNode, 'onscroll', function(e){
|
56
|
-
g.hScrollerNode.scrollLeft = t.domNode.scrollLeft;
|
57
|
-
});
|
58
|
-
|
59
|
-
t._moreNode = domConstruct.create('div', {
|
60
|
-
'class': 'gridxLoadMore'
|
61
|
-
});
|
62
|
-
t.arg('createMoreNode').call(t, t._moreNode);
|
63
|
-
t._prevNode = domConstruct.create('div', {
|
64
|
-
'class': 'gridxLoadMore'
|
65
|
-
});
|
66
|
-
t.arg('createPrevNode').call(t, t._prevNode);
|
67
|
-
|
68
|
-
t.connect(t._moreNode, 'onmouseover', function(){
|
69
|
-
query('> .gridxRowOver', t.domNode).removeClass('gridxRowOver');
|
70
|
-
});
|
71
|
-
t.connect(t._prevNode, 'onmouseover', function(){
|
72
|
-
query('> .gridxRowOver', t.domNode).removeClass('gridxRowOver');
|
73
|
-
});
|
74
|
-
t._initFocus();
|
75
|
-
},
|
76
|
-
|
77
|
-
_initFocus: function(){
|
78
|
-
var t = this,
|
79
|
-
focus = t.grid.focus,
|
80
|
-
doFocus = function(node, evt, step){
|
81
|
-
if(node.parentNode){
|
82
|
-
focus.stopEvent(evt);
|
83
|
-
var elems = a11y._getTabNavigable(node),
|
84
|
-
n = elems[step < 0 ? 'last' : 'first'];
|
85
|
-
if(n){
|
86
|
-
n.focus();
|
87
|
-
}
|
88
|
-
return !!n;
|
89
|
-
}else{
|
90
|
-
return false;
|
91
|
-
}
|
92
|
-
},
|
93
|
-
doBlur = function(node, evt, step){
|
94
|
-
if(node.parentNode){
|
95
|
-
var elems = a11y._getTabNavigable(node);
|
96
|
-
return evt ? evt.target == (step < 0 ? elems.first : elems.last) : true;
|
97
|
-
}else{
|
98
|
-
return true;
|
99
|
-
}
|
100
|
-
};
|
101
|
-
t.inherited(arguments);
|
102
|
-
focus.registerArea({
|
103
|
-
name: 'prevBtn',
|
104
|
-
priority: 0.9999,
|
105
|
-
focusNode: t._prevNode,
|
106
|
-
scope: t,
|
107
|
-
doFocus: lang.partial(doFocus, t._prevNode),
|
108
|
-
doBlur: lang.partial(doBlur, t._prevNode)
|
109
|
-
});
|
110
|
-
focus.registerArea({
|
111
|
-
name: 'moreBtn',
|
112
|
-
priority: 1.0001,
|
113
|
-
focusNode: t._moreNode,
|
114
|
-
scope: t,
|
115
|
-
doFocus: lang.partial(doFocus, t._moreNode),
|
116
|
-
doBlur: lang.partial(doBlur, t._moreNode)
|
117
|
-
});
|
118
|
-
},
|
119
|
-
|
120
|
-
createMoreNode: function(moreNode){
|
34
|
+
createBottom: function(bottomNode){
|
121
35
|
var t = this,
|
122
36
|
moreBtn = t._moreBtn = domConstruct.create('button', {
|
123
|
-
innerHTML: t.arg('loadMoreLabel', t.
|
124
|
-
},
|
125
|
-
t.connect(moreBtn,
|
37
|
+
innerHTML: t.arg('loadMoreLabel', t.grid.nls.loadMore)
|
38
|
+
}, bottomNode, 'last');
|
39
|
+
t.connect(moreBtn, 'onclick', function(){
|
126
40
|
t._load(1);
|
127
41
|
});
|
128
42
|
t.connect(moreBtn, 'onkeydown', function(evt){
|
@@ -132,12 +46,12 @@ define([
|
|
132
46
|
});
|
133
47
|
},
|
134
48
|
|
135
|
-
|
49
|
+
createTop: function(topNode){
|
136
50
|
var t = this,
|
137
51
|
prevBtn = t._prevBtn = domConstruct.create('button', {
|
138
|
-
innerHTML: t.arg('loadPreviousLabel', t.
|
139
|
-
},
|
140
|
-
t.connect(prevBtn,
|
52
|
+
innerHTML: t.arg('loadPreviousLabel', t.grid.nls.loadPrevious)
|
53
|
+
}, topNode, 'last');
|
54
|
+
t.connect(prevBtn, 'onclick', function(){
|
141
55
|
t._load();
|
142
56
|
});
|
143
57
|
t.connect(prevBtn, 'onkeydown', function(evt){
|
@@ -147,216 +61,12 @@ define([
|
|
147
61
|
});
|
148
62
|
},
|
149
63
|
|
150
|
-
|
151
|
-
var t = this,
|
152
|
-
view = t.grid.view;
|
153
|
-
t.aspect(t.model, 'onDelete', '_onDelete');
|
154
|
-
if(view._err){
|
155
|
-
t._loadFail(view._err);
|
156
|
-
}
|
157
|
-
t.loaded.callback();
|
158
|
-
},
|
159
|
-
|
160
|
-
refresh: function(start){
|
161
|
-
var t = this,
|
162
|
-
loadingNode = t.grid.loadingNode,
|
163
|
-
d = new Deferred();
|
164
|
-
delete t._err;
|
165
|
-
domClass.add(loadingNode, 'gridxLoading');
|
166
|
-
t.grid.view.updateVisualCount().then(function(){
|
167
|
-
try{
|
168
|
-
t.renderStart = 0;
|
169
|
-
var rc = t.renderCount = t.grid.view.visualCount;
|
170
|
-
if(typeof start == 'number' && start >= 0){
|
171
|
-
var count = rc - start,
|
172
|
-
n = query('> [visualindex="' + start + '"]', t.domNode)[0],
|
173
|
-
uncachedRows = [],
|
174
|
-
renderedRows = [],
|
175
|
-
rows = t._buildRows(start, count, uncachedRows, renderedRows);
|
176
|
-
if(rows){
|
177
|
-
domConstruct.place(rows, n || t._moreNode, 'before');
|
178
|
-
}
|
179
|
-
while(n && n !== t._moreNode){
|
180
|
-
var tmp = n.nextSibling,
|
181
|
-
vidx = parseInt(n.getAttribute('visualindex'), 10),
|
182
|
-
id = n.getAttribute('rowid');
|
183
|
-
domConstruct.destroy(n);
|
184
|
-
if(vidx >= start + count){
|
185
|
-
t.onUnrender(id);
|
186
|
-
}
|
187
|
-
n = tmp;
|
188
|
-
}
|
189
|
-
array.forEach(renderedRows, t.onAfterRow, t);
|
190
|
-
Deferred.when(t._buildUncachedRows(uncachedRows), function(){
|
191
|
-
t.onRender(start, count);
|
192
|
-
domClass.remove(loadingNode, 'gridxLoading');
|
193
|
-
d.callback();
|
194
|
-
});
|
195
|
-
}else{
|
196
|
-
t.renderRows(0, rc, 0, 1);
|
197
|
-
domClass.remove(loadingNode, 'gridxLoading');
|
198
|
-
d.callback();
|
199
|
-
}
|
200
|
-
}catch(e){
|
201
|
-
t._loadFail(e);
|
202
|
-
domClass.remove(loadingNode, 'gridxLoading');
|
203
|
-
d.errback(e);
|
204
|
-
}
|
205
|
-
}, function(e){
|
206
|
-
t._loadFail(e);
|
207
|
-
domClass.remove(loadingNode, 'gridxLoading');
|
208
|
-
d.errback(e);
|
209
|
-
});
|
210
|
-
return d;
|
211
|
-
},
|
212
|
-
|
213
|
-
renderRows: function(start, count, position){
|
214
|
-
var t = this,
|
215
|
-
g = t.grid,
|
216
|
-
uncachedRows = [],
|
217
|
-
renderedRows = [],
|
218
|
-
n = t.domNode,
|
219
|
-
en = g.emptyNode;
|
220
|
-
if(t._err){
|
221
|
-
return;
|
222
|
-
}
|
223
|
-
if(count > 0){
|
224
|
-
en.innerHTML = t.arg('loadingInfo', t._nls.loadingInfo);
|
225
|
-
en.style.zIndex = '';
|
226
|
-
var str = t._buildRows(start, count, uncachedRows, renderedRows);
|
227
|
-
t.renderStart = start;
|
228
|
-
t.renderCount = count;
|
229
|
-
n.scrollTop = 0;
|
230
|
-
if(has('ie')){
|
231
|
-
//In IE, setting innerHTML will completely destroy the node,
|
232
|
-
//But CellWidget still need it.
|
233
|
-
while(n.childNodes.length){
|
234
|
-
n.removeChild(n.firstChild);
|
235
|
-
}
|
236
|
-
}
|
237
|
-
n.innerHTML = str;
|
238
|
-
if(g.view.rootStart + g.view.rootCount < g.model.size()){
|
239
|
-
n.appendChild(t._moreNode);
|
240
|
-
}
|
241
|
-
n.scrollLeft = g.hScrollerNode.scrollLeft;
|
242
|
-
if(!str){
|
243
|
-
en.style.zIndex = 1;
|
244
|
-
}else{
|
245
|
-
en.innerHTML = '';
|
246
|
-
}
|
247
|
-
t.onUnrender();
|
248
|
-
array.forEach(renderedRows, t.onAfterRow, t);
|
249
|
-
Deferred.when(t._buildUncachedRows(uncachedRows), function(){
|
250
|
-
t.onRender(start, count);
|
251
|
-
});
|
252
|
-
}else if(!{top: 1, bottom: 1}[position]){
|
253
|
-
n.scrollTop = 0;
|
254
|
-
if(has('ie')){
|
255
|
-
//In IE, setting innerHTML will completely destroy the node,
|
256
|
-
//But CellWidget still need it.
|
257
|
-
while(n.childNodes.length){
|
258
|
-
n.removeChild(n.firstChild);
|
259
|
-
}
|
260
|
-
}
|
261
|
-
n.innerHTML = '';
|
262
|
-
en.innerHTML = t.arg('emptyInfo', t._nls.emptyInfo);
|
263
|
-
en.style.zIndex = 1;
|
264
|
-
t.onUnrender();
|
265
|
-
t.onEmpty();
|
266
|
-
t.model.free();
|
267
|
-
}
|
268
|
-
},
|
269
|
-
|
270
|
-
onRender: function(/*start, count*/){
|
271
|
-
//FIX #8746
|
272
|
-
var bn = this.domNode;
|
273
|
-
if(has('ie') < 9 && bn.childNodes.length){
|
274
|
-
query('> gridxLastRow', bn).removeClass('gridxLastRow');
|
275
|
-
if(bn.lastChild !== this._moreNode){
|
276
|
-
domClass.add(bn.lastChild, 'gridxLastRow');
|
277
|
-
}
|
278
|
-
}
|
279
|
-
},
|
280
|
-
|
281
|
-
_load: function(isPost){
|
282
|
-
var t = this,
|
283
|
-
g = t.grid,
|
284
|
-
m = t.model,
|
285
|
-
view = g.view,
|
286
|
-
pageSize = t.arg('pageSize'),
|
287
|
-
btnNode = isPost ? t._moreNode : t._prevNode,
|
288
|
-
start = view.rootStart,
|
289
|
-
count = view.rootCount,
|
290
|
-
newRootStart = isPost ? start : start < pageSize ? 0 : start - pageSize,
|
291
|
-
newRootCount = isPost ? count + pageSize : start + count - newRootStart,
|
292
|
-
finish = function(renderStart, renderCount){
|
293
|
-
t._busy(isPost);
|
294
|
-
t._checkSize(!isPost, function(){
|
295
|
-
query('.gridxBodyFirstRow').removeClass('gridxBodyFirstRow');
|
296
|
-
var firstRow = t._prevNode.nextSibling;
|
297
|
-
if(firstRow && firstRow != t._moreNode){
|
298
|
-
domClass.add(firstRow, 'gridxBodyFirstRow');
|
299
|
-
}
|
300
|
-
t.onRender(renderStart, renderCount);
|
301
|
-
});
|
302
|
-
};
|
303
|
-
t._busy(isPost, 1);
|
304
|
-
m.when({
|
305
|
-
start: isPost ? start + count : newRootStart,
|
306
|
-
count: isPost ? pageSize : start - newRootStart
|
307
|
-
}, function(){
|
308
|
-
var totalCount = m.size();
|
309
|
-
if(isPost && newRootStart + newRootCount > totalCount){
|
310
|
-
newRootCount = totalCount - newRootStart;
|
311
|
-
}
|
312
|
-
view.updateRootRange(newRootStart, newRootCount).then(function(){
|
313
|
-
var renderStart = isPost ? t.renderCount : 0,
|
314
|
-
renderCount = view.visualCount - t.renderCount;
|
315
|
-
t.renderStart = 0;
|
316
|
-
t.renderCount = view.visualCount;
|
317
|
-
if(renderCount){
|
318
|
-
var toFetch = [];
|
319
|
-
for(var i = 0; i < renderCount; ++i){
|
320
|
-
var rowInfo = view.getRowInfo({visualIndex: renderStart + i});
|
321
|
-
if(!m.isId(rowInfo.id)){
|
322
|
-
toFetch.push({
|
323
|
-
parentId: rowInfo.parentId,
|
324
|
-
start: rowInfo.rowIndex,
|
325
|
-
count: 1
|
326
|
-
});
|
327
|
-
}
|
328
|
-
}
|
329
|
-
m.when(toFetch, function(){
|
330
|
-
var renderedRows = [],
|
331
|
-
scrollHeight = g.bodyNode.scrollHeight;
|
332
|
-
str = t._buildRows(renderStart, renderCount, [], renderedRows);
|
333
|
-
domConstruct.place(str, btnNode, isPost ? 'before' : 'after');
|
334
|
-
if(!isPost){
|
335
|
-
g.bodyNode.scrollTop += g.bodyNode.scrollHeight - scrollHeight;
|
336
|
-
}
|
337
|
-
if(isPost ? view.rootStart + view.rootCount >= totalCount : view.rootStart === 0){
|
338
|
-
t.domNode.removeChild(btnNode);
|
339
|
-
}
|
340
|
-
array.forEach(renderedRows, t.onAfterRow, t);
|
341
|
-
finish(renderStart, renderCount);
|
342
|
-
});
|
343
|
-
}else{
|
344
|
-
t.domNode.removeChild(btnNode);
|
345
|
-
if(!isPost){
|
346
|
-
query('.gridxBodyFirstRow').removeClass('gridxBodyFirstRow');
|
347
|
-
}
|
348
|
-
finish(renderStart, renderCount);
|
349
|
-
}
|
350
|
-
});
|
351
|
-
});
|
352
|
-
},
|
353
|
-
|
354
|
-
_checkSize: function(isPost, onFinish){
|
64
|
+
_onLoadFinish: function(isPost, start, count, onFinish){
|
355
65
|
var t = this,
|
356
66
|
view = t.grid.view,
|
357
67
|
maxPageCount = t.arg('maxPageCount'),
|
358
68
|
maxRowCount = maxPageCount * t.arg('pageSize'),
|
359
|
-
btnNode = isPost ? t.
|
69
|
+
btnNode = isPost ? t._bottomNode : t._topNode;
|
360
70
|
if(maxPageCount > 0 && view.rootCount > maxRowCount){
|
361
71
|
var newRootStart = isPost ? view.rootStart : view.rootStart + view.rootCount - maxRowCount;
|
362
72
|
view.updateRootRange(newRootStart, maxRowCount).then(function(){
|
@@ -368,6 +78,7 @@ define([
|
|
368
78
|
t.renderCount = view.visualCount;
|
369
79
|
query('.gridxRow', t.domNode).forEach(function(node, i){
|
370
80
|
node.setAttribute('visualindex', i);
|
81
|
+
domClass.toggle(node, 'gridxRowOdd', i % 2);
|
371
82
|
});
|
372
83
|
domConstruct.place(btnNode, t.domNode, isPost ? 'last' : 'first');
|
373
84
|
if(!isPost){
|
@@ -385,25 +96,13 @@ define([
|
|
385
96
|
btn = isPost ? t._moreBtn : t._prevBtn,
|
386
97
|
cls = isPost ? "More" : "Previous";
|
387
98
|
btn.innerHTML = begin ?
|
388
|
-
'<span class="gridxLoadingMore"></span>' + t.arg('load' + cls + 'LoadingLabel', t.
|
389
|
-
t.arg('load' + cls + 'Label', t.
|
99
|
+
'<span class="gridxLoadingMore"></span>' + t.arg('load' + cls + 'LoadingLabel', t.grid.nls['load' + cls + 'Loading']) :
|
100
|
+
t.arg('load' + cls + 'Label', t.grid.nls['load' + cls]);
|
390
101
|
btn.disabled = !!begin;
|
391
|
-
}
|
102
|
+
}/*,
|
392
103
|
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
if(t.autoUpdate){
|
397
|
-
var node = t.getRowNode({rowId: id});
|
398
|
-
if(node){
|
399
|
-
var parentId = node.getAttribute('parentid'),
|
400
|
-
rowIndex = parseInt(node.getAttribute('rowindex'), 10);
|
401
|
-
if(parentId === '' && rowIndex >= view.rootStart && rowIndex < view.rootStart + view.rootCount){
|
402
|
-
view.updateRootRange(view.rootStart, view.rootCount - 1);
|
403
|
-
}
|
404
|
-
}
|
405
|
-
}
|
406
|
-
t.inherited(arguments);
|
407
|
-
}
|
104
|
+
_checkSpace: function(){
|
105
|
+
return this.inherited(arguments) && this.renderCount < this.arg('maxPageCount') * this.arg('pageSize');
|
106
|
+
}*/
|
408
107
|
});
|
409
108
|
});
|
@@ -0,0 +1,113 @@
|
|
1
|
+
define([
|
2
|
+
"dojo/_base/declare",
|
3
|
+
"dojo/query",
|
4
|
+
"dojo/_base/lang",
|
5
|
+
"dojo/_base/sniff",
|
6
|
+
"dojo/aspect",
|
7
|
+
"dojo/dom-construct",
|
8
|
+
"dojo/dom-class",
|
9
|
+
"dojo/dom-style",
|
10
|
+
"dojo/dom-geometry",
|
11
|
+
"dojo/keys",
|
12
|
+
"../core/_Module"
|
13
|
+
], function(declare, query, lang, has, aspect, domConstruct, domClass, domStyle, domGeo, keys, _Module){
|
14
|
+
|
15
|
+
return _Module.register(
|
16
|
+
declare(_Module, {
|
17
|
+
name: 'puller',
|
18
|
+
|
19
|
+
forced: ['vScroller'],
|
20
|
+
//node: null,
|
21
|
+
|
22
|
+
load: function(){
|
23
|
+
this.bind(this.arg('node'));
|
24
|
+
this.loaded.callback();
|
25
|
+
},
|
26
|
+
|
27
|
+
bind: function(node){
|
28
|
+
var t = this;
|
29
|
+
var g = t.grid;
|
30
|
+
t.unbind();
|
31
|
+
if(node && node != t.node){
|
32
|
+
t.node = node;
|
33
|
+
t.innerNode = node.firstChild;
|
34
|
+
g.vScroller.loaded.then(function(){
|
35
|
+
var scrollable = g.vScroller._scrollable;
|
36
|
+
if(scrollable){
|
37
|
+
t._height = t.node.clientHeight;
|
38
|
+
t._binds = [
|
39
|
+
t.aspect(scrollable, 'onTouchStart', function(){
|
40
|
+
t.node.style.height = t.node.clientHeight + 'px';
|
41
|
+
domClass.add(t.node, 'gridxPuller');
|
42
|
+
domClass.add(t.innerNode, 'gridxPullerInner');
|
43
|
+
t._pos = scrollable.getPos();
|
44
|
+
t._stage = 1;
|
45
|
+
}),
|
46
|
+
t.aspect(scrollable, 'scrollTo', function(to){
|
47
|
+
if(typeof to.y == 'number' && t._stage == 1){
|
48
|
+
var delta = to.y - t._pos.y;
|
49
|
+
var oldh = t.node.clientHeight;
|
50
|
+
var h = oldh + delta;
|
51
|
+
if(h < 0){
|
52
|
+
h = 0;
|
53
|
+
}else if(h > t._height){
|
54
|
+
h = t._height;
|
55
|
+
}
|
56
|
+
delta = h - oldh;
|
57
|
+
t._pos = to;
|
58
|
+
t.node.style.height = h + 'px';
|
59
|
+
g.mainNode.style.height = (g.mainNode.clientHeight - delta) + 'px';
|
60
|
+
g.vLayout.reLayout();
|
61
|
+
}
|
62
|
+
}),
|
63
|
+
t.aspect(scrollable, 'onTouchEnd', function(){
|
64
|
+
if(t.node.clientHeight < t._height / 2){
|
65
|
+
t._slide(0);
|
66
|
+
}else if(t.node.clientHeight >= t._height / 2){
|
67
|
+
t._slide(1);
|
68
|
+
}else{
|
69
|
+
t._stage = 0;
|
70
|
+
}
|
71
|
+
}, t, 'before')
|
72
|
+
];
|
73
|
+
}
|
74
|
+
});
|
75
|
+
}
|
76
|
+
},
|
77
|
+
|
78
|
+
unbind: function(){
|
79
|
+
var t = this;
|
80
|
+
if(t._binds){
|
81
|
+
for(var i = 0; i < t._binds.length; ++i){
|
82
|
+
t._binds[i].remove();
|
83
|
+
}
|
84
|
+
domClass.remove(t.node, 'gridxPuller');
|
85
|
+
domClass.remove(t.innerNode, 'gridxPullerInner');
|
86
|
+
t.node.style.height = '';
|
87
|
+
t.grid.vLayout.reLayout();
|
88
|
+
t._binds = t.node = null;
|
89
|
+
}
|
90
|
+
},
|
91
|
+
|
92
|
+
_slide: function(toShow){
|
93
|
+
var t = this;
|
94
|
+
var g = t.grid;
|
95
|
+
var targetHeight = toShow ? t._height : 0;
|
96
|
+
t._stage = 2;
|
97
|
+
domClass.add(t.node, 'gridxPullerAnim');
|
98
|
+
domClass.add(g.mainNode, 'gridxPullerAnim');
|
99
|
+
setTimeout(function(){
|
100
|
+
var h = t.node.offsetHeight - targetHeight;
|
101
|
+
t.node.style.height = targetHeight + 'px';
|
102
|
+
g.mainNode.style.height = (g.mainNode.clientHeight + h) + 'px';
|
103
|
+
setTimeout(function(){
|
104
|
+
domClass.remove(t.node, 'gridxPullerAnim');
|
105
|
+
domClass.remove(g.mainNode, 'gridxPullerAnim');
|
106
|
+
g.vLayout.reLayout();
|
107
|
+
t._stage = 0;
|
108
|
+
}, 500);
|
109
|
+
}, 10);
|
110
|
+
}
|
111
|
+
}));
|
112
|
+
|
113
|
+
});
|
@@ -1,6 +1,7 @@
|
|
1
1
|
define([
|
2
2
|
"dojo/_base/declare",
|
3
|
-
"dojo/query",
|
3
|
+
// "dojo/query",
|
4
|
+
'gridx/support/query',
|
4
5
|
"dojo/_base/lang",
|
5
6
|
"dojo/_base/sniff",
|
6
7
|
"dojo/aspect",
|
@@ -50,10 +51,7 @@ define([
|
|
50
51
|
this.headerNode = domConstruct.create('div', {
|
51
52
|
'class': 'gridxRowHeaderHeader',
|
52
53
|
role: 'row',
|
53
|
-
innerHTML:
|
54
|
-
this.arg('width'),
|
55
|
-
';"><tr><td class="gridxRowHeaderHeaderCell" role="rowheader" tabindex="-1"></td></tr></table>'
|
56
|
-
].join('')
|
54
|
+
innerHTML: '<table role="presentation" border="0" cellspacing="0" cellpadding="0" style="width: 100%;"><tr><td class="gridxRowHeaderHeaderCell" role="rowheader" tabindex="-1"></td></tr></table>'
|
57
55
|
});
|
58
56
|
this.bodyNode = domConstruct.create('div', {
|
59
57
|
'class': 'gridxRowHeaderBody'
|
@@ -369,6 +367,7 @@ define([
|
|
369
367
|
if(domClass.contains(node, 'gridxRowHeaderRow')){
|
370
368
|
var r = t.grid.body._focusCellRow = parseInt(node.getAttribute('visualindex'), 10);
|
371
369
|
t._focusRow(r);
|
370
|
+
t._onScroll();
|
372
371
|
return true;
|
373
372
|
}
|
374
373
|
node = node.parentNode;
|
@@ -396,15 +395,17 @@ define([
|
|
396
395
|
|
397
396
|
_onKeyDown: function(evt){
|
398
397
|
var t = this, g = t.grid;
|
399
|
-
if(g.focus.currentArea() == 'rowHeader' &&
|
398
|
+
if(!t._busy && g.focus.currentArea() == 'rowHeader' &&
|
400
399
|
evt.keyCode == keys.UP_ARROW || evt.keyCode == keys.DOWN_ARROW){
|
401
400
|
g.focus.stopEvent(evt);
|
402
401
|
var step = evt.keyCode == keys.UP_ARROW ? -1 : 1,
|
403
402
|
body = g.body,
|
404
403
|
r = body._focusCellRow + step;
|
405
404
|
body._focusCellRow = r = r < 0 ? 0 : (r >= g.view.visualCount ? g.view.visualCount - 1 : r);
|
405
|
+
t._busy = 1;
|
406
406
|
g.vScroller.scrollToRow(r).then(function(){
|
407
407
|
t._focusRow(r);
|
408
|
+
t._busy = 0;
|
408
409
|
t.onMoveToRowHeaderCell(r, evt);
|
409
410
|
});
|
410
411
|
}
|
@@ -5,7 +5,7 @@ define([
|
|
5
5
|
"dojo/_base/declare",
|
6
6
|
"dojo/_base/array",
|
7
7
|
"dojo/dom-class",
|
8
|
-
|
8
|
+
"dojo/aspect",
|
9
9
|
"dojo/query"
|
10
10
|
], function(kernel, lang, _Module, declare, array, domClass, aspect, query){
|
11
11
|
kernel.experimental('gridx/modules/RowLock');
|
@@ -36,26 +36,41 @@ define([
|
|
36
36
|
count: 0,
|
37
37
|
load: function(args, deferStartup){
|
38
38
|
this.count = this.arg('count');
|
39
|
-
var _this = this,
|
40
|
-
g = this.grid;
|
39
|
+
var _this = this, g = this.grid;
|
41
40
|
|
42
41
|
deferStartup.then(function(){
|
43
42
|
|
44
|
-
if(_this.grid.vScroller)
|
45
|
-
_this.
|
46
|
-
|
43
|
+
if(_this.grid.vScroller){
|
44
|
+
_this.connect(g.vScrollerNode, 'onscroll', function(){
|
45
|
+
_this._updateRowPosition();
|
46
|
+
});
|
47
|
+
}
|
48
|
+
|
49
|
+
if(_this.grid.vScroller && _this.grid.rowHeader){
|
50
|
+
_this.connect(g.bodyNode, 'onscroll', function(){
|
51
|
+
_this._updateRowHeaderPosition();
|
52
|
+
});
|
53
|
+
}
|
54
|
+
|
55
|
+
if(g.columnResizer){
|
56
|
+
//make it compatible with column resizer
|
57
|
+
_this.connect(g.columnResizer, 'onResize', '_adjustBody');
|
58
|
+
_this.connect(g.columnResizer, 'onResize', '_updatePosition');
|
59
|
+
}
|
60
|
+
|
61
|
+
|
47
62
|
|
48
63
|
_this.lock(_this.count);
|
49
64
|
_this.loaded.callback();
|
50
65
|
});
|
66
|
+
|
51
67
|
aspect.before(g.body, 'refresh', function(){
|
52
68
|
_this.grid.bodyNode.style.paddingTop = '0px';
|
53
69
|
});
|
54
|
-
|
70
|
+
|
55
71
|
this.connect(g.body, 'refresh', function(){
|
56
72
|
//FIX ME
|
57
73
|
//the lock can't run before vscroll._doScroll()
|
58
|
-
_this.grid.bodyNode.style.paddingTop = '0px';
|
59
74
|
setTimeout(function(){
|
60
75
|
_this.lock(_this.count);
|
61
76
|
}, 0);
|
@@ -74,6 +89,8 @@ define([
|
|
74
89
|
|
75
90
|
this._adjustBody();
|
76
91
|
this._updatePosition();
|
92
|
+
|
93
|
+
|
77
94
|
},
|
78
95
|
|
79
96
|
unlock: function(){
|
@@ -104,10 +121,19 @@ define([
|
|
104
121
|
this.grid.bodyNode.style.paddingTop = h + 'px';
|
105
122
|
if(this.grid.rowHeader){
|
106
123
|
this.grid.rowHeader.bodyNode.style.paddingTop = h + 'px';
|
107
|
-
}
|
124
|
+
}
|
108
125
|
},
|
109
126
|
|
110
127
|
_updatePosition: function(){
|
128
|
+
// summary:
|
129
|
+
// Update position of locked rows so that they look like locked.
|
130
|
+
this._updateRowPosition();
|
131
|
+
if(this.grid.rowHeader){
|
132
|
+
this._updateRowHeaderPosition();
|
133
|
+
}
|
134
|
+
},
|
135
|
+
|
136
|
+
_updateRowPosition: function(){
|
111
137
|
// summary:
|
112
138
|
// Update position of locked rows so that they look like locked.
|
113
139
|
if(!this.count){return;}
|
@@ -115,28 +141,32 @@ define([
|
|
115
141
|
this._foreachLockedRows(function(node){
|
116
142
|
node.style.top = t + h + 'px';
|
117
143
|
h += node.offsetHeight;
|
118
|
-
},
|
144
|
+
}, null);
|
145
|
+
},
|
146
|
+
|
147
|
+
_updateRowHeaderPosition: function(){
|
148
|
+
// summary:
|
149
|
+
// Update position of locked rowHeaders so that they look like locked.
|
150
|
+
if(!this.count){return;}
|
151
|
+
var t = this.grid.bodyNode.scrollTop, h = 0, _this = this;
|
152
|
+
this._foreachLockedRows(null, function(rowHeaderNode){
|
119
153
|
rowHeaderNode.style.top = t + h + 'px';
|
154
|
+
h += rowHeaderNode.offsetHeight;
|
120
155
|
});
|
121
156
|
},
|
122
|
-
|
157
|
+
|
123
158
|
_foreachLockedRows: function(callback, rowHeaderCallback){
|
124
|
-
rowHeaderCallback = rowHeaderCallback? rowHeaderCallback : callback;
|
159
|
+
// rowHeaderCallback = rowHeaderCallback? rowHeaderCallback : callback;
|
125
160
|
var nodes = this.grid.bodyNode.childNodes;
|
126
161
|
var rowHeaderNodes = this.grid.rowHeader? this.grid.rowHeader.bodyNode.childNodes : [];
|
127
162
|
for(var i = 0; i < this.count; i++){
|
128
|
-
if(rowHeaderNodes[i]){
|
163
|
+
if(rowHeaderNodes[i] && rowHeaderCallback){
|
129
164
|
rowHeaderCallback(rowHeaderNodes[i]);
|
130
165
|
}
|
131
|
-
if(nodes[i]){
|
166
|
+
if(nodes[i] && callback){
|
132
167
|
callback(nodes[i]);
|
133
168
|
}
|
134
169
|
}
|
135
|
-
},
|
136
|
-
|
137
|
-
_restoreLock: function(){
|
138
|
-
console.log('restore lock')
|
139
|
-
this.lock(this.count);
|
140
170
|
}
|
141
171
|
|
142
172
|
});
|