我在我的应用程序中使用 angular js 使用 kendo tabstrip。标签条和内容看起来很好。
我可以通过 k-options 获取从角度调用的选项卡事件或设置事件吗?
需要帮助
我在我的应用程序中使用 angular js 使用 kendo tabstrip。标签条和内容看起来很好。
我可以通过 k-options 获取从角度调用的选项卡事件或设置事件吗?
需要帮助
我使用无范围,但与乔提到的相同......
HTML:如果您使用 $scope,只需删除“vm”。
<div kendo-tab-strip="vm.tabstrip" k-options="vm.tabOptions" k-content-urls="[null, null]">
控制器:(如果您使用 $scope,只需将“vm”替换为“$scope”
vm.tabOptions = {
select: function (e) {
console.log("Selected: " + e.item.innerText);
},
activate: function (e) {
console.log("Activated: " + e.item.innerText);
},
show: function (e) {
console.log("Shown: " + e.item.innerText);
},
contentLoad: function (e) {
console.log("Content loaded in " + e.item.innerText);
},
error: function (e) {
console.log("Loading failed with " + e.xhr.statusText + " " + e.xhr.status);
}
};
如果您设置了标签条,则可以通过以下方式处理事件k-options
<div kendo-tab-strip k-options="configOptions" k-content-urls="[ null, null]">
<script>
angular.module("KendoDemos", [ "kendo.directives" ]);
function MyCtrl($scope) {
$scope.hello = "Hello from Controller!";
$scope.configOptions = {
change: function(e) {
console.log("changed");
}
}
}
</script>
那是你要找的吗?