Hello.
Ive got two comboboxes:
-first one:
-second one:
Here is my read action signature:
When im putting some data in Dim1 ComboBox its sending it to controller with no problem, the child combobox (Dim2) becoming enable and everythings ok. But when Im starting to putting data in second combobox (Dim2) its sending only the parent data (Barcode from Dim1) and no Dim2 data:/
When im putting data in Dim2 I want to have Dim1 data under "Barcode" parameter and Dim2 data under "text" parameter.
What am I doing wrong?
Please help me!
I hope ive described it enough clearly.
Thanks!
Ive got two comboboxes:
-first one:
@(Html.Kendo().ComboBox()
.Name(
"Dim1"
)
.DataTextField(
"Barcode"
)
.DataValueField(
"Barcode"
)
.Filter(FilterType.StartsWith)
.DataSource(action => action.Read(read => read.Action(
"GetStockLocationsForComboBoxAjax"
,
"StockLocation"
)).ServerFiltering(
true
))
.MinLength(3)
)
<script type=
"text/javascript"
>
function onAdditionalData() {
return
{ Barcode: $(
"#Dim1"
).val() };
}
</script>
@(Html.Kendo().ComboBox()
.Name(
"Dim2"
)
.DataTextField(
"Barcode"
)
.DataValueField(
"Barcode"
)
.Filter(FilterType.StartsWith)
.DataSource(action => action.Read(read => read.Action(
"GetStockLocationsForComboBoxAjax"
,
"StockLocation"
).Data(
"onAdditionalData"
)).ServerFiltering(
true
))
.MinLength(3)
.CascadeFrom(
"Dim1"
)
)
[HttpGet]
public
JsonResult GetStockLocationsForComboBoxAjax([DataSourceRequest] DataSourceRequest request,
string
text,
string
Barcode)
When im putting some data in Dim1 ComboBox its sending it to controller with no problem, the child combobox (Dim2) becoming enable and everythings ok. But when Im starting to putting data in second combobox (Dim2) its sending only the parent data (Barcode from Dim1) and no Dim2 data:/
When im putting data in Dim2 I want to have Dim1 data under "Barcode" parameter and Dim2 data under "text" parameter.
What am I doing wrong?
Please help me!
I hope ive described it enough clearly.
Thanks!