角度格子ツール(レイアウト用)と角度webix(ウィジェット作成用)を使用してダッシュボードレイアウトを作成しようとしています。私が直面している1つの問題は、webixウィジェットが、ダッシュボードページが表示されたときに2回初期化されていて、内部的にすべてのウィジェットを2回レンダリングすることです。アプリケーションの小さなサンプルは、誰もがその理由やこれに対する任意の修正を与えることができ、以下のフィドルリンクWebixウィジェットは、角度付きグリッターと一緒に使用すると2回インスタンス化されます
<body>
<div ng-controller="SampleController">
<div gridster="gridsterOptions">
<div class="widget-container" gridster-item="widget" ng-repeat="widget in widgets">
<div webix-ui="widget" webix-ready='resize(root)'></div>
</div>
</div>
</div>
</body>
$(function() {
webix.protoUI({
"name": "SampleWidget",
$init: function(config) {
alert("In $init");
this.$view.className = config.css;
this.$view.innerHTML = "Hai";
}
}, webix.MouseEvents, webix.EventSystem, webix.ui.view);
//Initialising app
var webixApp = angular.module('webixApp', ['webix', 'gridster']);
var gridsterOptions = {
columns: 12,
margins: [10, 10],
outerMargin: false,
mobileBreakPoint: 600,
width: 'auto',
colWidth: 'auto',
minSizeY: 15,
minSizeX: 2,
rowHeight: 10
};
//controller
webixApp.controller('SampleController', function($scope, $timeout) {
$scope.gridsterOptions = gridsterOptions;
$scope.widgets = [{
view: 'SampleWidget',
id: 'Sample',
css: 'sample-widget'
}];
});
angular.bootstrap($("body"), ["webixApp"]);
});
https://jsfiddle.net/rajisht/L3a3k624/
で入手できますか?