I am successfully done cascading drop-down. But my requirement is to bind dropdown depend on the value of textbox.
Can you please help me.
My code snipe
<td class="EditlableTD">
@Html.LabelFor(model => model.ReferredBy)
</td>
<td class="EditTextBoxTD">
<input type="text" id="R_Ranks" name="ReferredBy" class="k-textbox" />
</td>
</tr>
<tr>
<td class="EditlableTD">
Rank
</td>
<td class="EditTextBoxTD">
<script>
function filterRank() {
return {
R_Ranks: $("#R_Ranks").val()
};
}
</script>
@(Html.Kendo().DropDownList()
.Name("Rank")
.OptionLabel("Select Rank...")
.DataTextField("Rk_Name")
.DataValueField("Rk_InternalCode")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("ShowSelectedRank", "Home")
.Data("filterRank");
})
.ServerFiltering(true);
})
.Enable(true)
.AutoBind(false)
//.CascadeFrom("BranchCode")
.HtmlAttributes(new {style="width:200px;" })
)
</td>
</tr>
It bind value first time depend on R_Ranks text box value. But 2nd time text change does not effect the dropdown bind.
Can you please help me.
My code snipe
<td class="EditlableTD">
@Html.LabelFor(model => model.ReferredBy)
</td>
<td class="EditTextBoxTD">
<input type="text" id="R_Ranks" name="ReferredBy" class="k-textbox" />
</td>
</tr>
<tr>
<td class="EditlableTD">
Rank
</td>
<td class="EditTextBoxTD">
<script>
function filterRank() {
return {
R_Ranks: $("#R_Ranks").val()
};
}
</script>
@(Html.Kendo().DropDownList()
.Name("Rank")
.OptionLabel("Select Rank...")
.DataTextField("Rk_Name")
.DataValueField("Rk_InternalCode")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("ShowSelectedRank", "Home")
.Data("filterRank");
})
.ServerFiltering(true);
})
.Enable(true)
.AutoBind(false)
//.CascadeFrom("BranchCode")
.HtmlAttributes(new {style="width:200px;" })
)
</td>
</tr>
It bind value first time depend on R_Ranks text box value. But 2nd time text change does not effect the dropdown bind.