Html Code:
-------------------------------------------------<input type="text" placeholder="" name="cmbEmployee" id="cmbEmployee" />
Jquery Code:
----------------------------------------------------------------
GenerateEmployeeCombo: function () {
$("#cmbEmployee").kendoComboBox({
placeholder: "Select",
dataTextField: "EmployeeName",
dataValueField: "EmployeeId",
dataSource: [{EmployeeId:1,EmployeeName:"Mr. A"},
{EmployeeId:2,EmployeeName:"Mr. B"},
{EmployeeId:3,EmployeeName:"Mr. C"}],
index: 0,
suggest: true,
filter: "contains"
});
},
--------------------------------------------------------------------------------------------
Get Data From KendoComboBox:
var empId=$("#cmbEmployee").data("kendoComboBox").value();
--------------------------------------------------------------------------------------------
Fill KendoComboBox With Value:
var empoyeeId=1 ;
var empId=$("#cmbEmployee").data("kendoComboBox").value(empId);
----------------------------------------------------------------------------------------
Clear KendoComboBox:
$("#cmbEmployee").data("kendoComboBox").value("");
---------------------------------------------------------------------------------------
Enable/Disable KendoComboBox:
$("#cmbEmployee").data("kendoComboBox").enable(true);
$("#cmbEmployee").data("kendoComboBox").enable(false);
0 Comments