Skip to content

Commit

Permalink
Context Menu / Scrolling: apply mvc demo
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkithelegendarypokemonster committed Apr 29, 2024
1 parent ef7a8cd commit 33881ef
Show file tree
Hide file tree
Showing 6 changed files with 1,296 additions and 3 deletions.
10 changes: 10 additions & 0 deletions MVCDemos/Content/DemosStyles/ContextMenu/Scrolling.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.target-area {
color: var(--dx-color-text);
background-color: var(--dx-color-border);
height: 300px;
max-width: 600px;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
}
16 changes: 13 additions & 3 deletions MVCDemos/Controllers/ContextMenuController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using DevExtreme.AspNet.Data;
using DevExtreme.AspNet.Mvc;
using DevExtreme.MVC.Demos.Models.SampleData;
using Newtonsoft.Json;
using System.Web.Mvc;

namespace DevExtreme.MVC.Demos.Controllers {
Expand All @@ -9,8 +10,17 @@ public ActionResult Basics() {
return View();
}

public ActionResult Scrolling() {
return View();
}

public ActionResult Templates() {
return View();
}

[HttpGet]
public ActionResult GetScrollingProducts(DataSourceLoadOptions loadOptions) {
return Json(DataSourceLoader.Load(ContextMenuData.Products, loadOptions), JsonRequestBehavior.AllowGet);
}
}
}
4 changes: 4 additions & 0 deletions MVCDemos/DevExtreme.MVC.Demos.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,9 @@
<Compile Include="Models\OrgItems.cs" />
<Compile Include="Models\ContextMenuItem.cs" />
<Compile Include="Models\RowReorderingTask.cs" />
<Compile Include="Models\ContextMenuScrollingItem.cs" />
<Compile Include="Models\SampleData\ActiveCompanies.cs" />
<Compile Include="Models\SampleData\ContextMenuData.cs" />
<Compile Include="Models\SampleData\AdaptabilityAppointments.cs" />
<Compile Include="Models\SampleData\AgendaTasks.cs" />
<Compile Include="Models\SampleData\AnnotationData.cs" />
Expand Down Expand Up @@ -676,6 +678,7 @@
<DependentUpon>Northwind.mdf</DependentUpon>
</Content>
<Content Include="Content\demo-template.css" />
<Content Include="Content\DemosStyles\ContextMenu\Scrolling.css" />
<Content Include="Content\DemosStyles\Charts\AxisCustomPosition.css" />
<Content Include="Content\DemosStyles\Charts\CustomAnnotations.css" />
<Content Include="Content\DemosStyles\Charts\CustomLegendMarkers.css" />
Expand Down Expand Up @@ -1943,6 +1946,7 @@
<Content Include="Views\Lookup\Basics.cshtml" />
<Content Include="Views\Gallery\ItemTemplate.cshtml" />
<Content Include="Views\ContextMenu\Basics.cshtml" />
<Content Include="Views\ContextMenu\Scrolling.cshtml" />
<Content Include="Views\Charts\PiesWithEqualSize.cshtml" />
<Content Include="Views\Charts\AxisLabelsOverlapping.cshtml" />
<Content Include="Views\ContextMenu\Templates.cshtml" />
Expand Down
10 changes: 10 additions & 0 deletions MVCDemos/Models/ContextMenuScrollingItem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;

namespace DevExtreme.MVC.Demos.Models {
public class ContextMenuScrollingItem {
public string text { get; set; }
public IEnumerable<ContextMenuScrollingItem> items { get; set; }
}
}
Loading

0 comments on commit 33881ef

Please sign in to comment.