2013-04-12 121 views

回答

1

read方法

.Read(read => read.Action("GetAllMessage", "Account").Data("getMsgType")).PageSize(10) 

這個功能,將讀取下拉列表值;

function getMsgType() 
{ 
    return { 
     SpecialityIn: $("#MsgType").val() 
    }; 
} 

$( 「#MSGTYPE」)將是你dropdownListId

下拉的亨德爾change事件對電網onChageEevent

@(Html.Kendo().DropDownListFor(m => m.MsgType) 
       .Events(events=>events.Change("OnMsgTypeChange")) 
         .Name("MsgType") 
         .HtmlAttributes(new { style = "width:200px;font-size:12px;margin-top:6px;" }) 
         .DataTextField("Description") 
         .DataValueField("MsgType") 
         .DataSource(source => { source.Read(read => { read.Action("readMsgType", "Account") })}) 
         .OptionLabel("Select") 
         .Enable(false) 
         .AutoBind(true) 

       ) 

綁定網格,

function OnMsgTypeChange() { 
    $("#GridMsgList").data("kendoGrid").dataSource.read(); 
} 
+0

它適合我 – user632299

1

你嘗試劍道UI下拉列表事件網格的

http://demos.kendoui.com/web/dropdownlist/events.html

function onSelect(e) { 
         if ("kendoConsole" in window) { 
          var dataItem = this.dataItem(e.item.index()); 
          kendoConsole.log("event :: select (" + dataItem.text + " : " + dataItem.value + ")"); 
         } 
        }; 

$("#dropdownlist").kendoDropDownList({ 
         dataTextField: "text", 
         dataValueField: "value", 
         dataSource: data, 
         select: onSelect 
        });