Drop down menu 剑道输入与大数据源
我已经创建了一个剑道网格,以及一个自定义表格,用于选定的网格行。 使用AngularJS,我将所选行数据存储到'formData'变量中。 比如说Drop down menu 剑道输入与大数据源,drop-down-menu,kendo-ui,datasource,large-data,Drop Down Menu,Kendo Ui,Datasource,Large Data,我已经创建了一个剑道网格,以及一个自定义表格,用于选定的网格行。 使用AngularJS,我将所选行数据存储到'formData'变量中。 比如说 $scope.fromData = { uid: guid, id: guid, name: string, otherEntityId: guid } 现在,在我的表单中,有一个“otherEntityId”的KendoDropDown输入。 使用dataTextField和dataValueField,我想查看其他数据源并基于
$scope.fromData = { uid: guid, id: guid, name: string, otherEntityId: guid }
现在,在我的表单中,有一个“otherEntityId”的KendoDropDown输入。
使用dataTextField和dataValueField,我想查看其他数据源并基于外键显示其他属性
dataTextField: "Name",
dataValueField: "otherEntityId",
例如,我有一个实体和一个人
{id:guid,name:string,cityId:guid}
另一个实体是
{name:string,id:guid}
其中,第一个cityId与第二个实体id相同
在我的表单中,我有来自第一个数据源的id,在我的输入中,我显示了基于id的名称,类似于“查找”字段
问题是我的第二个实体的数据源太大,无法立即加载
我想要一种机制,对于网格中的每一行选择,输入将发送一个请求,并在数据源中使用过滤器,如
dataSource.filter = { field: dataValueField, operator: "eq", value: $scope.formDataItem[dataValueField] };
当用户点击查看dropdownlist输入的更多选项时,我希望有其他类似“startswith”的过滤器
dataSource.filter = { field: dataTextField, operator: "startswith", value: getInput().text() };
你怎么能做到?如何更改开放事件上数据源的筛选器?我使用筛选事件。所以当我初始化带有guid的数据源筛选器中的值时,因此只能加载一个项;当名为的筛选事件发生时,我更改筛选器并正常工作
$scope.options.filtering = function (e) {
e.preventDefault();
if (prevText.length >= minLength) {
delete dataSource.filter;
dataSource.filter = { field: dataTextField, operator: "startswith", value: getInput()._prev};
getInput().setDataSource(dataSource);
}
else
getInput().setDataSource({ data: [] });
}