This question is locked. New answers and comments are not allowed.
Hi, im trying to make it so that when i select an element on the grid, an html.hidden value is set to the selected row's value, and then i want the form to be submitted so that some elements on the screen are saved and others are updated. Im not sure if this is a telerik problem or a jquery problem. This is what i have for the telerik grid:
<% Html.Telerik().Grid<WasteStreamGenerator>("GeneratedWaste")
.Name("GeneratedWasteGrid")
.DataKeys(keys => keys.Add(c => c.Id))
.Columns(columns =>
{
columns.Bound(t => t.Id).Visible(false);
columns.Bound(t => t.WasteType.IsNos).Title("N/D");
columns.Bound(t => t.WasteType.ShippingName).Title("Shipping Name");
columns.Bound(t => t.WasteType.WasteCode.WasteCodeCode).Title("Waste Code");
columns.Bound(t => t.WasteType.Pin).Title("TDGA/PIN");
columns.Bound(t => t.WasteType.Class).Title("Class");
columns.Bound(t => t.PackingGroup.PackingGroupCode).Title("Packing Group");
columns.Bound(t => t.HandlingCode.Id).Title("Handling Code");
columns.Bound(t => t.SourceQuantity).Title("Quantity");
columns.Bound(t => t.Unit.UnitCode).Title("Unit");
})
.ClientEvents(events => events.OnRowSelect("onRowSelect"))
.Selectable()
.Render();
and this is my onRowSelect function:
function onRowSelect(e) {
var row = e.row;
$('#postId').val('-1');
$("#mainform").submit();
}
Now the function is being called, and when i use firebug to trace it, it goes through all of the elements, but the post doesnt happen. Is there anything that i can do to get this behaviour?
<% Html.Telerik().Grid<WasteStreamGenerator>("GeneratedWaste")
.Name("GeneratedWasteGrid")
.DataKeys(keys => keys.Add(c => c.Id))
.Columns(columns =>
{
columns.Bound(t => t.Id).Visible(false);
columns.Bound(t => t.WasteType.IsNos).Title("N/D");
columns.Bound(t => t.WasteType.ShippingName).Title("Shipping Name");
columns.Bound(t => t.WasteType.WasteCode.WasteCodeCode).Title("Waste Code");
columns.Bound(t => t.WasteType.Pin).Title("TDGA/PIN");
columns.Bound(t => t.WasteType.Class).Title("Class");
columns.Bound(t => t.PackingGroup.PackingGroupCode).Title("Packing Group");
columns.Bound(t => t.HandlingCode.Id).Title("Handling Code");
columns.Bound(t => t.SourceQuantity).Title("Quantity");
columns.Bound(t => t.Unit.UnitCode).Title("Unit");
})
.ClientEvents(events => events.OnRowSelect("onRowSelect"))
.Selectable()
.Render();
and this is my onRowSelect function:
function onRowSelect(e) {
var row = e.row;
$('#postId').val('-1');
$("#mainform").submit();
}
Now the function is being called, and when i use firebug to trace it, it goes through all of the elements, but the post doesnt happen. Is there anything that i can do to get this behaviour?