mirror of https://github.com/abpframework/abp.git
10 changed files with 100 additions and 7 deletions
@ -0,0 +1,29 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using DashboardDemo.Localization.DashboardDemo; |
|||
using DashboardDemo.Pages.widgets; |
|||
using DashboardDemo.Pages.widgets.Filters; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Dashboards; |
|||
using Volo.Abp.Localization; |
|||
|
|||
namespace DashboardDemo.GlobalFilters |
|||
{ |
|||
public static class GlobalFilterDefinitionProvider |
|||
{ |
|||
public static List<GlobalFilterDefinition> GetDefinitions() |
|||
{ |
|||
var dateRangeFilter = new GlobalFilterDefinition( |
|||
DateRangeGlobalFilterViewComponent.GlobalFilterName, |
|||
LocalizableString.Create<DashboardDemoResource>("DateRangeFilter"), |
|||
typeof(DateRangeGlobalFilterViewComponent) |
|||
); |
|||
|
|||
return new List<GlobalFilterDefinition> |
|||
{ |
|||
dateRangeFilter |
|||
}; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
(function ($) { |
|||
var $container = $('#DateRangeGlobalFilterContainer'); |
|||
if ($container.length > 0) { |
|||
console.log("GlobalRefreshButton loaded"); |
|||
} |
|||
})(jQuery); |
|||
@ -0,0 +1,12 @@ |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
|||
|
|||
namespace DashboardDemo.Pages.widgets.Filters |
|||
{ |
|||
public class DateRangeGlobalFilterScriptContributor : BundleContributor |
|||
{ |
|||
public override void ConfigureBundle(BundleConfigurationContext context) |
|||
{ |
|||
context.Files.Add("/Pages/widgets/Filters/DateRangeGlobalFilter.js"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
@inject IHtmlLocalizer<DashboardDemoResource> L |
|||
@using DashboardDemo.Localization.DashboardDemo |
|||
@using Microsoft.AspNetCore.Mvc.Localization |
|||
@model DashboardDemo.Pages.widgets.Filters.DateRangeGlobalFilterViewComponent |
|||
@{ |
|||
} |
|||
<div id="DateRangeGlobalFilterContainer"> |
|||
<abp-button button-type="Success" text="@L["Refresh"].Value" id="GlobalRefreshButton"/> |
|||
</div> |
|||
|
|||
@ -0,0 +1,17 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
|
|||
namespace DashboardDemo.Pages.widgets.Filters |
|||
{ |
|||
[ViewComponent] |
|||
public class DateRangeGlobalFilterViewComponent : ViewComponent |
|||
{ |
|||
public const string GlobalFilterName = "DateRangeGlobalFilter"; |
|||
|
|||
public const string DisplayName = "Date Range Filter"; |
|||
|
|||
public IViewComponentResult Invoke() |
|||
{ |
|||
return View("/Pages/widgets/Filters/DateRangeGlobalFilterViewComponent.cshtml", new DateRangeGlobalFilterViewComponent()); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue