-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor DataPager to rely on Repeater, and not change its data context
- Loading branch information
Showing
8 changed files
with
147 additions
and
215 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using DotVVM.Framework.Binding.Expressions; | ||
|
||
namespace DotVVM.Framework.Controls | ||
{ | ||
public class DataPagerCommands | ||
public class DataPagerBindings | ||
{ | ||
public ICommandBinding? GoToFirstPage { get; init; } | ||
public ICommandBinding? GoToPreviousPage { get; init; } | ||
public ICommandBinding? GoToNextPage { get; init; } | ||
public ICommandBinding? GoToLastPage { get; init; } | ||
public ICommandBinding? GoToPage { get; init; } | ||
|
||
public IStaticValueBinding<bool>? IsFirstPage { get; init; } | ||
public IStaticValueBinding<bool>? IsLastPage { get; init; } | ||
public IStaticValueBinding<IEnumerable<int>>? PageNumbers { get; init; } | ||
public IStaticValueBinding<bool>? IsActivePage { get; init; } | ||
public IStaticValueBinding<string>? PageNumberText { get; init; } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 10 additions & 10 deletions
20
src/Tests/ControlTests/testoutputs/DataPagerTests.CommandDataPager-command-bindings.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
((PagingOptions)_parent.PagingOptions).GoToPage(_thisIndex); | ||
((IRefreshableGridViewDataSet)_parent).RequestRefresh() | ||
((PagingOptions)_this.PagingOptions).GoToFirstPage(); | ||
((IRefreshableGridViewDataSet)_this).RequestRefresh() | ||
((PagingOptions)_this.PagingOptions).GoToLastPage(); | ||
((IRefreshableGridViewDataSet)_this).RequestRefresh() | ||
((PagingOptions)_this.PagingOptions).GoToNextPage(); | ||
((IRefreshableGridViewDataSet)_this).RequestRefresh() | ||
((PagingOptions)_this.PagingOptions).GoToPreviousPage(); | ||
((IRefreshableGridViewDataSet)_this).RequestRefresh() | ||
((PagingOptions)_this.Customers.PagingOptions).GoToFirstPage(); | ||
((IRefreshableGridViewDataSet)_this.Customers).RequestRefresh() | ||
((PagingOptions)_this.Customers.PagingOptions).GoToLastPage(); | ||
((IRefreshableGridViewDataSet)_this.Customers).RequestRefresh() | ||
((PagingOptions)_this.Customers.PagingOptions).GoToNextPage(); | ||
((IRefreshableGridViewDataSet)_this.Customers).RequestRefresh() | ||
((PagingOptions)_this.Customers.PagingOptions).GoToPage(_thisIndex); | ||
((IRefreshableGridViewDataSet)_this.Customers).RequestRefresh() | ||
((PagingOptions)_this.Customers.PagingOptions).GoToPreviousPage(); | ||
((IRefreshableGridViewDataSet)_this.Customers).RequestRefresh() |
27 changes: 12 additions & 15 deletions
27
src/Tests/ControlTests/testoutputs/DataPagerTests.CommandDataPager.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.