Telerik UI for asp.net core 2024.1.130
I need to pass a parameter from dropdownlist selection to the ajax function that refreshes the grid. Using the following code to accomplish this using taghelper syntax, however the parameter is not getting passed to ajax api. Could you please help?
<form id="frmEnableFeed">
<div class="mb-3 form-group">
<label asp-for="SelectedAirline" class="form-label">Select the Airline to configure:</label>
<kendo-dropdownlist class="form-select" name="SelectedAirline"
datatextfield="Text"
datavaluefield="Value"
bind-to="Model.CompanySelectList"
option-label="Please select an Airline..."
filter="FilterType.Contains">
</kendo-dropdownlist>
<div class="mb-3 form-group">
<kendo-grid name="grid" height="430">
<datasource type="DataSourceTagHelperType.Ajax" page-size="20"
on-error="error_handler">
<schema data="Data" total="Total">
<model id="AirlineID">
<fields>
<field name="AirlineID" type="string" editable="false"></field>
<field name="AirlineName" type="string"></field>
<field name="Enabled" type="boolean"></field>
</fields>
</model>
</schema>
<transport>
<read url="@Url.Action("GetAirlines", "Feed")" />
</transport>
</datasource>
<columns>
<column field="AirlineName" />
<column field="ITP Services" width="100" />
<column field="Feed Enabled" width="100" />
</columns>
<toolbar>
<toolbar-button name="create"></toolbar-button>
</toolbar>
<editable mode="popup" />
<pageable enabled="true" />
<sortable enabled="true" />
<scrollable enabled="true" />
</kendo-grid>
</div>
<div class="mb-3 form-group">
<button type="submit" class="btn btn-primary" id="btnSaveChange">Save Changes</button>
</div>
</form>
@section Scripts {
<partial name="_ValidationScriptsPartial" />
<script>
$(function () {
$("#SelectedItp").change(function () {
var cid = $(this).val();
var grid = $("#grid").data("kendoGrid");
grid.dataSource.read({ companyId: cid });
})
});
</script>
}