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

How to pass parameters to window

1 Answer 419 Views
Window
This is a migrated thread and some comments may be shown as answers.
Vince
Top achievements
Rank 1
Vince asked on 11 May 2013, 02:57 PM
Hi I'm fairly new in web development so please excuse my ignorance. I'm using the grid and have a custom toolbar command. When the custom command is clicked and a row is selected I want to pass the selected row data to the window. Can someone please tell me what would be the correct/preferred way to do this? Right now I have the selected row data and I can pop up my window. I read through the forums and some hinted about a partial view?? I'm assuming you would have the window display the partial view which has your model of data that you would want to send back to the server when the user clicks a save button for example but as I said I also want to display the additional row data in the window.

Any help would greatly be appreciated especially with a basic example of how to call a window and pass data from the main page.

Vince.

1 Answer, 1 is accepted

Sort by
0
Accepted
Vince
Top achievements
Rank 1
answered on 11 Jun 2013, 03:52 PM
I just set the value and html using jquery before opening the window e.g.

else if (command == COMMAND.COMMENT) {
    $('#visitId').val(dataItem.VisitId);
    $('#Account').html("<label>Account:</label>" + dataItem.Site.Account);
    $('#VisitDate').html("<label>Visit Date:</label>" + kendo.format("{0:D}", dataItem.VisitDate));
    $('#Comment').val("");
    $("#commentBtn").hide();
    var commentWindow = $("#commentWindow").data("kendoWindow").center().open();
 }
Tags
Window
Asked by
Vince
Top achievements
Rank 1
Answers by
Vince
Top achievements
Rank 1
Share this question
or