HierarchicalDataSourceBuilder

Methods

Custom()

Use it to configure Custom binding.

Example

Razor
 
              .DataSource(dataSource => dataSource
                  .Custom()
                  .Transport(transport => transport
                      .Read("Read", "TreeViewData")
                  )
              })  
             

Read(System.Action)

Configures the URL for Read operation.

Parameters

configurator - System.Action<CrudOperationBuilder>

Configures the Read operation settings.

Example

Razor
 
                .DataSource(dataSource =>
                {
                    dataSource.Read(operation => operation
                        .Type(HttpVerbs.Post)
                        .Action("Read", "TreeViewData")
                    );
                })  
             

Read(System.String,System.String,System.Object)

Sets controller, action and routeValues for Read operation.

Parameters

actionName - System.String

Action name

controllerName - System.String

Controller Name

routeValues - System.Object

Route values

Example

Razor
 
                .DataSource(dataSource =>
                {
                     dataSource.Read("Read", "TreeViewData", new { id = 1 });
                })  
             

Read(System.String,System.String)

Sets controller and action for Read operation.

Parameters

actionName - System.String

Action name

controllerName - System.String

Controller Name

Example

Razor
 
               .DataSource(dataSource =>
               {
                    dataSource.Read("Read", "TreeViewData");
               })  
             

Events(System.Action)

Configures the client-side events

Parameters

configurator - System.Action<DataSourceEventBuilder>

Example

Razor
 
                .DataSource(dataSource => dataSource
                    .Read("Read", "TreeViewData")
                    .Events(events => events.RequestStart("onRequestStart"))
                )
             

Model(System.Action)

Configures the model

Parameters

configurator - System.Action<HierarchicalModelDescriptorBuilder>

Configures the Model of the DataSource.

Example

Razor
 
               .DataSource(dataSource => dataSource
                     .Read("Read", "TreeViewData")
                     .Model(model => model
                          .HasChildren("hasChildren")
                     )
               )
             

ServerFiltering()

Specifies if filtering should be handled by the server.

Example

Razor
 
                    .DataSource(dataSource => dataSource
                          .Read("Read", "TreeViewData")
                          .ServerFiltering()
                    )
             

ServerFiltering(System.Boolean)

Specifies if filtering should be handled by the server.

Parameters

enabled - System.Boolean

Example

Razor
 
                .DataSource(dataSource => dataSource
                    .Read("Read", "TreeViewData")
                    .ServerFiltering(true)
                )