This is a migrated thread and some comments may be shown as answers.

How to referencing value from Textbox in the GridEvents

2 Answers 216 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Neer
Top achievements
Rank 1
Neer asked on 09 Sep 2014, 08:05 PM
Hi,

When running the Create, Read, Update, Destroy events. I want to pass in the value of  $("MasterAccountID") to the controller. I can't figure out how to do with, without writing the JavaScript manually.

<input type="textbox" name="MasterAccountID"  id="MasterAccountID" />
@(Html.Kendo().Grid<Ownership>() // Specify the type of the grid
                .Name("Ownership")
                .Columns(columns =>
                {
                    columns.Bound(o => o.AccountName);
                    columns.Bound(o => o.AccountNumber);
                    columns.Bound(o => o.Percent);
                    columns.Bound(o => o.Status);
                    columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200);
                })
 
                .DataSource(dataSource => dataSource
                    .Ajax()
                    .ServerOperation(true)
                    .PageSize(20)
                    .Model(model =>
                    {
                        model.Id(o => o.AccountNumber);
                    })
 
                    .Read(read => read.Action("Ownership_Read", "Owner", [PASS TEXTBOX VALUE]))
                )
        )

2 Answers, 1 is accepted

Sort by
0
Neer
Top achievements
Rank 1
answered on 10 Sep 2014, 06:06 PM
Figured it out.

.Update(update => update
.Action("Action", "Controller")
                          .Data("additionalData")
)
0
Dimiter Madjarov
Telerik team
answered on 11 Sep 2014, 07:26 AM
Hello Neer,


Indeed this is the correct approach to send additional data with the request.

Do not hesitate to contact us again if further issues arise.

Regards,
Dimiter Madjarov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Neer
Top achievements
Rank 1
Answers by
Neer
Top achievements
Rank 1
Dimiter Madjarov
Telerik team
Share this question
or