You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/integrations/dotnet/howtostart-blazor.md
+9-235Lines changed: 9 additions & 235 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,19 +7,6 @@ sidebar_label: "Blazor"
7
7
8
8
This tutorial gives you step-by-step instructions on how to host Scheduler inside a Blazor Web App. Blazor renders the host page, [JavaScript interop](https://learn.microsoft.com/en-us/aspnet/core/blazor/javascript-interoperability/) initializes the Scheduler widget, and an ASP.NET Core Web API controller serves CRUD requests.
9
9
10
-
You can also read tutorials on other server-side technologies:
11
-
12
-
-[dhtmlxScheduler with ASP.NET Core](integrations/dotnet/howtostart-dotnet-core.md)
13
-
-[dhtmlxScheduler with ASP.NET MVC](integrations/dotnet/howtostart-dotnet.md)
14
-
-[dhtmlxScheduler with Node.js](integrations/node/howtostart-nodejs.md)
15
-
-[dhtmlxScheduler with FastAPI](integrations/python/howtostart-fastapi.md)
16
-
-[dhtmlxScheduler with PHP](integrations/php/howtostart-plain-php.md)
17
-
-[dhtmlxScheduler with PHP:Slim](integrations/php/howtostart-php-slim4.md)
18
-
-[dhtmlxScheduler with PHP:Laravel](integrations/php/howtostart-php-laravel.md)
19
-
-[dhtmlxScheduler with SalesForce LWC](integrations/salesforce/howtostart-salesforce.md)
20
-
-[dhtmlxScheduler with Ruby on Rails](integrations/other/howtostart-ruby.md)
21
-
-[dhtmlxScheduler with dhtmlxConnector](integrations/other/howtostart-connector.md)
22
-
23
10
The application is built with the .NET 10 SDK and Visual Studio Code with the [C# Dev Kit](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit). Visual Studio 2022 works as well. To keep the example focused on Scheduler integration, the demo stores events in an in-memory list rather than a database; for a persistent storage example see the [ASP.NET Core integration guide](integrations/dotnet/howtostart-dotnet-core.md#step-3-creating-models-and-database).
24
11
25
12
:::note
@@ -117,14 +104,7 @@ Next steps will show you how to create a backend API and connect Scheduler to it
117
104
118
105
## Step 3. Creating models
119
106
120
-
Let's begin with a data model. You'll need a class for scheduler events. dhtmlxScheduler uses [non-conventional names for model properties](guides/data-formats.md#json) from the .NET world perspective.
121
-
122
-
To deal with this, the [Data Transfer Object (DTO)](https://learn.microsoft.com/en-us/aspnet/web-api/overview/data/using-web-api-with-entity-framework/part-5) pattern will be used. Two kinds of models will be defined:
123
-
124
-
- a domain model class that will be used inside the app
125
-
- a DTO class that will be used to communicate with the Web API.
126
-
127
-
Then mapping between the two models is implemented as explicit conversion operators.
107
+
Let's begin with a data model. You'll need a class for scheduler events. dhtmlxScheduler uses [non-conventional names for model properties](guides/data-formats.md#json) from the .NET world perspective. This uses the same DTO pattern explained in the [ASP.NET Core tutorial](integrations/dotnet/howtostart-dotnet-core.md#define-dtos-and-mapping); the Blazor-adapted version is below.
128
108
129
109
Create a **Models** folder in the project root. First, the domain model:
130
110
@@ -321,223 +301,17 @@ The default `date_format` config string can't express the ISO `T` delimiter, so
321
301
322
302
Everything is ready. You can run the application and see the fully-fledged Scheduler.
323
303
324
-
## Dynamic loading
325
-
326
-
Each time scheduler calls our `GET` action, it loads the whole events list. It may be ok for a start, but after the app is used for several months the amount of data transferred will grow dramatically. So it may be worthwhile to implement dynamic loading, which allows scheduler to load only a required events range.
327
-
328
-
On the client side it is enabled by the [scheduler.setLoadMode](api/method/setloadmode.md) method:
329
-
330
-
~~~js title="wwwroot/lib/scheduler/scheduler.js"
331
-
scheduler.setLoadMode("day");
332
-
// load data from backend
333
-
scheduler.load("/api/scheduler");
334
-
~~~
335
-
336
-
After that scheduler will start adding `from` and `to` date parameters to GET requests, so the backend can return only events between these dates.
337
-
338
-
All we need to do is to read those parameters in our `GET` action and filter events appropriately:
Lastly, we need to modify our PUT/POST/DELETE actions in order to [handle special rules of recurring events](guides/recurring-events.md#editingdeleting-a-certain-occurrence-in-the-series).
304
+
## See also
443
305
444
-
Firstly, the `POST` action. We need to process a special case for recurring events - deletion of a specific occurrence of the recurring series requires creating a new record and the client will call the `insert` action for it:
306
+
The Web API controller in this tutorial is a basic CRUD skeleton on top of in-memory storage. The topics below apply equally to a Blazor host but are not duplicated here - follow the ASP.NET Core integration guide:
In the `PUT` action we need to make sure to update all properties of the model. Additionally, we need to handle a different special case there: when a recurring series is modified, we need to delete all modified occurrences of that series:
For a persistent backend (Entity Framework Core + SQL Server), the [ASP.NET Core tutorial](integrations/dotnet/howtostart-dotnet-core.md) covers the full setup.
0 commit comments