Suoranta.WebApp.Types Namespace
Suoranta.WebApp.View Namespace
Suoranta.WebApp - Developer API

Dom<(Of <(<'TPageModel>)>)>..::..ActionParam Method (String, String, Element)

Add on the page JavaScript that returns JS object containing POST parameter for controller action.

Namespace:  Suoranta.WebApp.View
Assembly:  Suoranta.WebApp (in Suoranta.WebApp.dll)

Syntax


public Symbol ActionParam(
	string action,
	string paramName,
	Dom..::..Element bindTo
)

Parameters

action
Type: String
paramName
Type: String
bindTo
Type: Suoranta.WebApp.View..::..Dom..::..Element
HTML element from which the function retrieves the value

Return Value

Name of the added JS function (informational).

Remarks


[KF.CrudOperationBuilderBase{TCrudOperationBuilder}.Data(string)] requires a named JavaScript function that returns named action parameters in a JSON object. This method generates the required function. [WidgetExtensions.Source{TList, TListBuilder}(TListBuilder, string, Kendo.Data.DataSettings, Type)] and its variants know from action method's signature that it requires parameters. Builder is then automatically bound to the JS function generated by this method.

Examples


Action GetAttachments(long parentId) is used to populate
C#
@(this.Widgets().MultiSelectFor(model => model.AttachmentIDs)
      .Source<SomeController, long>(c => c.GetAttachments)
Then ActionParam("GetAttachments", "Some", Dom.ParentSelector) will generate the JS function GetAttachmentsParams that retrieves parentId.