This question is locked. New answers and comments are not allowed.
Hi all
Been looking at forum, so many variations and ways to do things. It gets overwhelming.
I am trying to add a custom button which will call an action on my controller but the action needs to be called from a Javascript function because I need to pass a Javascript value as a parameter. Here is what I got...just pieces of ideas but nothing concrete yet:
Any ideas? Thank you!
Been looking at forum, so many variations and ways to do things. It gets overwhelming.
I am trying to add a custom button which will call an action on my controller but the action needs to be called from a Javascript function because I need to pass a Javascript value as a parameter. Here is what I got...just pieces of ideas but nothing concrete yet:
@(Html.Telerik().Grid((IEnumerable<ViewModels.NormalMode.FullWindowsStats>)ViewData["FullWindowsStats"]) .Name("TopGrid") .NoRecordsTemplate("No records to display.") //.ToolBar(commands => commands.Custom().Text("Export to CSV").Action("ExportCsv", "NormalMode")) //this works but I need to pass a javascript variable as param //.ToolBar(commands => commands.Custom().ButtonType(GridButtonType.ImageAndText) // .ImageHtmlAttributes(new { @class = "t-icon t-edit", onclick = "runAction('test')" }).Text("CSV")) .ToolBar(toolBar => toolBar.Template(@<text><a class="t-button t-grid-add">Export CSV</a> <span id="my-status-message"/></text>))... function runAction(name) { alert(name); // ajaxRequest('@Url.Action("Action", "Controller")', { param1: variable1 }); }Any ideas? Thank you!