私は再利用可能な部分表示でComboBoxを持っています。 getAddionalDataを使用してコントローラにさらにパラメータを渡そうとすると、コンボボックスの入力を関数に渡すことができますか?私はコンボボックスのIDを直接呼び出すことはできませんgetAddionalDataの値を取得する複数の可能性があり、私は正確なIDは、関数を呼び出すのか分からないためです。私は関数内で 'this'修飾子を使用しようとしましたが、それは私に読まれたURLだけを与えます。たとえば、dataBound関数でthis.open()を呼び出すと、コンボボックスが開きます。私はここでそれを使うことはできません。何か案が?私はKendo : ComboBox in a grid - Sending additional data of selected combobox to combobox Read()を見て、それが私に必要なものを手に入れませんでした。 Telerik、http://www.telerik.com/forums/how-to-find-id-of-kendo-dropdownlist-in-event-handlerパー剣道コンボボックスと追加のデータをコントローラに渡す
@(Html.Kendo().ComboBoxFor(m=>m.Id)
.DataTextField("xxxx")
.DataValueField("xxxx")
.Placeholder("xxxx")
.MinLength(3)
.AutoBind(false)
.Events(e=>e.DataBound("functionCall").Change("functionCall"))
.TemplateId("templateId")
.HtmlAttributes(new { @class = "form-control", style = "width:100%" })
.Filter("contains")
.Delay(500)
.DataSource(source => source.Read(read => read.Action("method", "controller").Data("getAdditionalData(#=input.val()#)"))
.ServerFiltering(true))
.Height(500)
)
var getAdditionalData = function (e) {
//somehow get id of combobox calling the function and get the value of the input to pass to controller
//can't use 'this' or e.sender
return {
text: value,
searchLocation: "xxxx",
searchType: "xxxx"
}
}
'getAdditionalData()'関数のコードを投稿できますか? –
@ mmillican – jgabb
別のコンボボックス(またはこれ)のデータを取得しようとしていますか? –