Hi there,
I am continuing to eval the kendo grid for purchase and seeing if I can get it working in my application which is using MVC 4 and kendo 2013.1.319.
While swapping in the dropdown I am running into an error for only certain records where the Select Event function on the dropdown is not recognized; even though it is present in the javascript. Its weird because it works for most records that visit the details page and once in awhile it breaks and I can't figure out why. Any ideas?
For example:
I am binding this list with a selectlist in the controller and the values are properly set. there is a full list and the Id is there in the list.
//select list on the viewmodel
pvModel.CostCenterList = new SelectList(_setupBiz.GetNonOverheadCostCenters(), "Key", "Value",pvModel.CostCenterId);
I have this DDL on the .cshtml page
@(Html.Kendo().DropDownList()
.Name("CostCenter")
.OptionLabel("Pick a costcenter...")
.BindTo(Model.CostCenterList)
.Events(e=>e.Select("CostCenterSelect"))
)
and this script in my <scripts> section
function CostCenterSelect(e) {
var costCenter = this.dataItem(e.item.index());
if (costCenter.Value > 0) {
//stuff happens
}
else {
//hide a bunch of buttons }
};
I am continuing to eval the kendo grid for purchase and seeing if I can get it working in my application which is using MVC 4 and kendo 2013.1.319.
While swapping in the dropdown I am running into an error for only certain records where the Select Event function on the dropdown is not recognized; even though it is present in the javascript. Its weird because it works for most records that visit the details page and once in awhile it breaks and I can't figure out why. Any ideas?
For example:
I am binding this list with a selectlist in the controller and the values are properly set. there is a full list and the Id is there in the list.
//select list on the viewmodel
pvModel.CostCenterList = new SelectList(_setupBiz.GetNonOverheadCostCenters(), "Key", "Value",pvModel.CostCenterId);
I have this DDL on the .cshtml page
@(Html.Kendo().DropDownList()
.Name("CostCenter")
.OptionLabel("Pick a costcenter...")
.BindTo(Model.CostCenterList)
.Events(e=>e.Select("CostCenterSelect"))
)
and this script in my <scripts> section
function CostCenterSelect(e) {
var costCenter = this.dataItem(e.item.index());
if (costCenter.Value > 0) {
//stuff happens
}
else {
//hide a bunch of buttons }
};