简体   繁体   English

如何为剑道调度程序资源模板编写更改 function

[英]How to write a change function for kendo scheduler Resource template

I Have the following resources in my kendo scheduler.我的剑道调度程序中有以下资源。 can anyone suggest to me how to sort the second dropdownlist based on selected criteria of the first dropdown list?谁能建议我如何根据第一个下拉列表的选定标准对第二个下拉列表进行排序? below is my code下面是我的代码

@(Html.Kendo().Scheduler<Proj.Models.Data.Scheduler>()
.Name("scheduler")
.Date(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day))
.StartTime(new DateTime(DateTime.Now.Year, 1, 1, 7, 00, 00))
.Editable()
.Views(views =>
{
    views.DayView();
    views.WeekView();
    views.MonthView(MonthView => MonthView.Selected(true));
})
.Resources(resource =>
{     
    resource.Add(m => m.TypeID) //need to get the selected id of this dropdownlist and load the second dropdown
        .Title("Type")
        .Name("maintype")
        .DataTextField("TYPENAME")
        .DataValueField("TYPECODE")
        .BindTo(@proj.Models.GeneralModule.lstlookup);

    resource.Add(m => m.SubTypeID)
        .Title("Sub Type")
        .DataTextField("MASTERNAME")
        .DataValueField("MASTERID")
        .DataSource(ds => ds.Read(read => read.Action("loadSubTypeScheduler", "Config").Data("DataFilter")).ServerFiltering(false));

})
.DataSource(d => d
    .Model(m =>
    {
        m.Id(f => f.TaskID);
        m.Field(f => f.OwnerID);
    })
.ServerOperation(true)
)
)

Can anyone help me with this?谁能帮我这个? I was trying with some class selector using jQuery, but it is not happening.我正在尝试使用 jQuery 使用一些 class 选择器,但它没有发生。 My requirement is to filter the subtype dropdown based on the Type dropdown.我的要求是根据类型下拉列表过滤子类型下拉列表。

Use the change event of the first dropdown使用第一个下拉菜单的 change 事件

.Events(e =>
            {
                e.Change("onChange")
            })

then create your jQuery function:然后创建您的 jQuery function:

function onChange(e){
                    var dataItem = this.dataItem(e.item);
    var itemText = dataItem.Text;
    var itemValue = dataItem.Value;        
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM