or
@Html.Kendo().DropDownListFor(x => x.TrainList).BindTo(Model.TrainList).HtmlAttributes(new { style = "width:150px" }).DataTextField("CNX_AUT").DataValueField("Id").Name("trainList").Value("Id").Text("CNX_AUT")
@Html.Kendo().NumericTextBoxFor(x => x.BeltScaleWeight).Name("beltScaleWeight").HtmlAttributes(new { style = "width:150px" })
<
button
class
=
"k-button"
id
=
"applyToCars"
style
=
"width:150px"
>Apply To Cars</
button
>
<
div
id
=
"GridWindow"
>
<
br
/>
<
br
/>
@(Html.Kendo().Grid<
CNX.Domain.Entities.EDIRailcar
>()
.Name("RailCarGrid")
.Columns(columns =>
{
columns.Bound(o => o.Id).Visible(false);
columns.Bound(o => o.EDI_417_TRAIN_GUID).Visible(false);
columns.Bound(o => o.EQUIPMENT_INITIAL);
columns.Bound(o => o.EQUIPMENT_NUMBER);
columns.Bound(o => o.WEIGHT);
columns.Bound(o => o.TARE_WEIGHT);
columns.Bound(o => o.AS_RECEIVED_WEIGHT);
columns.Bound(o => o.Pile);
columns.Bound(o => o.Class);
columns.Bound(o => o.STATUS);
})
.DataSource(dataSource => dataSource.Ajax()
.PageSize(10)
.Read(read => read.Action("ApplyWeights", "MenuWeight")
.Type(HttpVerbs.Post))
.Model(model => model.Id(o => o.Id)))
.Pageable()
.Sortable()
.Filterable()
)
</
div
>
<
script
type
=
"text/javascript"
>
$(document).ready(function () {
var win = $("#GridWindow").kendoWindow({
actions: ["Maximize", "Minimize", "Close"],
draggable: true,
height: "500px",
width: "500px",
modal: true,
resizable: true,
visible: false,
position: { top: 100, left: 100 }
}).data("kendoWindow");
});
$("#applyToCars").click(function () {
var selectedTrain = $("#trainList").data("kendoDropDownList");
var weightValue = $("#beltScaleWeight").data("kendoNumericTextBox");
var win = $("#GridWindow").data("kendoWindow");
var grid = $("#RailCarGrid").data("kendoGrid");
/*How do i pass the values they selected to the controller? */
grid.dataSource.fetch();
win.title('Railcar weights for ' + selectedTrain.text() );
win.center();
win.open();
});
</
script
>
data-series-colors:"['yellow','red','green']"
<
div
data-role
=
"view"
data-title
=
"Views"
data-layout
=
"main-default"
>
<
a
href
=
"page2.html" id="broken"
>Remote View</
a
>
<
ul
data-role
=
"listview"
data-style
=
"inset"
data-type
=
"group"
>
<
li
>Sources
<
ul
>
<
li
><
a
href
=
"#secondview"
>Local View</
a
></
li
>
<
li
><
a
href
=
"page2.html" id="works"
>Remote View</
a
></
li
>
</
ul
>
</
li
>
</
ul
>
<
ul
data-role
=
"listview"
data-style
=
"inset"
data-type
=
"group"
>
<
li
>Types
<
ul
>
<
li
><
a
href
=
"#stretchview"
>Stretched View</
a
></
li
>
</
ul
>
</
li
>
</
ul
>
</
div
>
change: function (e) {
if (this.select() < 0) {
//do something here
}
}