Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/447.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何设置新数据源并用新数据刷新剑道网格?_Javascript_Angularjs_Kendo Grid - Fatal编程技术网

Javascript 如何设置新数据源并用新数据刷新剑道网格?

Javascript 如何设置新数据源并用新数据刷新剑道网格?,javascript,angularjs,kendo-grid,Javascript,Angularjs,Kendo Grid,我现在在添加所有者网格配置中有了$scope.addProcessOwner函数,当用户单击我正在使用selectedOwners创建新数组对象的每个所有者时,现在我想将selectedOwners设置为所选所有者网格的数据源 1-如何将selectedOwners设置为selectedOwnerGridOptions的数据源 2-从添加所有者网格中选择所有者后,如何刷新所选所有者网格 grid.html 添加所有者 <div kendo-grid="ownerSearch" option

我现在在添加所有者网格配置中有了
$scope.addProcessOwner
函数,当用户单击我正在使用
selectedOwners
创建新数组对象的每个所有者时,现在我想将
selectedOwners
设置为所选所有者网格的数据源

1-如何将
selectedOwners
设置为
selectedOwnerGridOptions
的数据源

2-从添加所有者网格中选择所有者后,如何刷新所选所有者网格

grid.html

添加所有者

<div kendo-grid="ownerSearch" options="ownerSearchResultGrid"
                    k-rebind="getOwnerSearchResultGrid"></div>
与此相反:

$scope.selectedOwnerGrid = selectedOwners;
$scope.selectedOwnerGridOptions.dataSource.read();
试试这个:

$scope.selectedOwnerGridOptions.dataSource.data(selectedOwners);

它添加第一个所有者,并抛出错误
TypeError:无法读取未定义的属性“数据”
知道原因吗
$scope.selectedOwnerGrid = selectedOwners;
$scope.selectedOwnerGridOptions.dataSource.read();
$scope.selectedOwnerGridOptions.dataSource.data(selectedOwners);