Hi I am very new to this and need help in kendoDropDownList
I am using kendoDropDownList and as soon as user selects the dropdown item - i need to postback to Controller action method with the appropriate value
ex: if user selects "Test 1", i need to send to controller "4" - how do i do it?
here is my code
$(document).ready(function () {
var data = [
{ text: "ALL", value: "-1" },
{ text: "Test 1", value: "4" },
{ text: "Test 2", value: "32" }
];
//var selectedValue = $("#assayTypeIDIndex").val();
$("#ddlAssayType").kendoDropDownList({
dataTextField: "text",
dataValueField: "value",
dataSource: data,
ignoreCase: false,
select: onSelect,
index: 0 // another issue is I cannot set the selectedValue (defined above) here????? if i do it this wouldn't work - only numeric hardcoded value (0 or 1 or 2) will work
});
function onSelect(e) {
var atIdx = e.item.index();
var atValue = this.dataItem(e.item.index()).value;
$('#assayTypeIDIndex').val(atIdx);
$("#assayTypeIDFilter").val(atValue);
$("#assayTypeIDSearch").val(atValue);
$(this).closest('form').submit();
}
thanks in adv...
I am using kendoDropDownList and as soon as user selects the dropdown item - i need to postback to Controller action method with the appropriate value
ex: if user selects "Test 1", i need to send to controller "4" - how do i do it?
here is my code
$(document).ready(function () {
var data = [
{ text: "ALL", value: "-1" },
{ text: "Test 1", value: "4" },
{ text: "Test 2", value: "32" }
];
//var selectedValue = $("#assayTypeIDIndex").val();
$("#ddlAssayType").kendoDropDownList({
dataTextField: "text",
dataValueField: "value",
dataSource: data,
ignoreCase: false,
select: onSelect,
index: 0 // another issue is I cannot set the selectedValue (defined above) here????? if i do it this wouldn't work - only numeric hardcoded value (0 or 1 or 2) will work
});
function onSelect(e) {
var atIdx = e.item.index();
var atValue = this.dataItem(e.item.index()).value;
$('#assayTypeIDIndex').val(atIdx);
$("#assayTypeIDFilter").val(atValue);
$("#assayTypeIDSearch").val(atValue);
$(this).closest('form').submit();
}
thanks in adv...