This question is locked. New answers and comments are not allowed.
Hi Friends ,
Hi this is shanker i am doing poroject on mvc . my requirement is Grid filtering with dropdown selected value in on change event of drop down .I wrote script code for onchange . But I get runtime script error that isMicrosoft JScript runtime error: 'OnchangeD
above code is onchange function
my controls are
Please how to solve this problem please help me
thanks and regards
shanker.B
Hi this is shanker i am doing poroject on mvc . my requirement is Grid filtering with dropdown selected value in on change event of drop down .I wrote script code for onchange . But I get runtime script error that is
Microsoft JScript runtime error: 'OnchangeDrop' is undefined I face this error . how to solve this problem please help me
<script type=
"text/javascript"
>
function
onchangeDrop(e) {
var
list_id = e.value;
$(
'#DDDGrid'
).show(
'slow'
);
var
DDDGrid = $(
'#DDDGrid'
).data(
'tGrid'
);
DDDGrid.rebind({list_id:list_id});
}
</script>
above code is onchange function
my controls are
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<
SAMA.DataModels.Common.DropDownData
>" %>
<
h2
>
Drop Down Data</
h2
>
<
b
>Facilty Name :</
b
><%: ViewData["FaciltyName"]%><
br
/>
<
b
>Drop Down Data:</
b
>
<%=Html.Telerik().DropDownList()
.Name("DropDownData")
.DataBinding(binding=>binding.Ajax().Select("DropDownLookup","User"))
.ClientEvents(events => events.OnChange("onchangeDrop"))
%>
<
p
>
<%= Html.Telerik().Grid<
DropDownData
>()
.Name("DDDGrid")
.HtmlAttributes(new { style = "display:none;" })
.ToolBar(tbar => tbar.Insert())
.DataKeys(keys => keys.Add(o => o.list_id).RouteKey("list_id"))
.DataKeys(keys=>keys.Add(o=>o.row_id).RouteKey("row_id"))
.DataBinding(dataBinding => dataBinding.Ajax()
.Select("drop_down_dataDetail", "User", new { list_id = "-1" })
.Insert("drop_down_data_Insert", "User")
.Update("drop_down_data_Update", "User")
.Delete("drop_down_data_Delete", "User"))
.Columns(columns =>
{
columns.Bound(o => o.name).Title("Name").Width(100);
columns.Bound(o => o.description).Title("Description").Width(100);
columns.Bound(o => o.active).ClientTemplate("<
input
id
=
ddd
type
=
checkbox
disabled
=
true
<#=active?'checked':'' #> /> ").Width(150);
columns.Command(commands =>
{
commands.Edit();
commands.Delete();
}).Width(200);
})
.Editable(editing => editing.Mode(GridEditMode.InLine))
.Pageable()
%>
</
p
>
<
script
type
=
"text/javascript"
>
function onchangeDrop(e) {
var list_id = e.value;
$('#DDDGrid').show('slow');
var DDDGrid = $('#DDDGrid').data('tGrid');
DDDGrid.rebind({list_id:list_id});
}
</
script
>
Please how to solve this problem please help me
thanks and regards
shanker.B