Skip to main content

ControllerDataSourceOptionsBuilder.OnInserted(RazorBlock) Method

A function that is executed after a data item is added.

Namespace: DevExtreme.AspNet.Mvc.Builders.DataSources

Assembly: DevExtreme.AspNet.Core.dll

Declaration

public ControllerDataSourceOptionsBuilder OnInserted(
    RazorBlock jsFunc
)

Parameters

Name Type Description
jsFunc RazorBlock

The Razor @<text> block that contains JavaScript function code.

Returns

Type Description
ControllerDataSourceOptionsBuilder

A reference to this instance after the method is called.

Remarks

Use this method to specify a JavaScript handler for the client-side inserted event.

@(Html.DevExtreme().DataGrid()
    .DataSource(d => d.Mvc()
        .OnInserted(@<text>
            function(e) {
                // Handler code
            }
        </text>)
    )
)

Refer to API Controllers for more information.

See Also