如何知道在被解雇之后哪个单元格已被更改' onResizeEnd' DHTMLX网格上的活动?

时间:2014-06-16 15:05:22

标签: grid dhtmlx

我试图在解雇后获取小区信息' onResizeEnd' DHTMLX网格上的活动。

如您所知,DHTMLX网格使用鼠标拖动提供单元格宽度的动态更改。

我真的想知道..如何获取有关细胞或细胞索引的信息,在鼠标拖动后细胞宽度发生了变化。

我想制作单独的网格列表设置。所以我需要每个列的宽度和那些宽度改变为什么。

我的英语很差。但我想你们都明白我想知道的事情。

请帮助我。

1 个答案:

答案 0 :(得分:0)

我就是这样做的:

<!Doctype html>
<html>
<body>
<div ng-app="main">
  <div ng-controller="AboutController">
    <canvas tc-chartjs-doughnut chart-options="options" chart-data="data" auto-legend></canvas>
  </div>
</div>
<script src="bower_components/Chart.js/Chart.min.js"></script>
<script src="bower_components/angular/angular.min.js"></script>
<script src="bower_components/tc-angular-chartjs/dist/tc-angular-chartjs.min.js"></script>
<script>
  angular
      .module('main', ['tc.chartjs'])
      .controller('AboutController', ['$scope', function ($scope) {
        $scope.data = [
          {
            value: 300,
            color: '#F7464A',
            highlight: '#FF5A5E',
            label: 'Red'
          },
          {
            value: 50,
            color: '#46BFBD',
            highlight: '#5AD3D1',
            label: 'Green'
          },
          {
            value: 100,
            color: '#FDB45C',
            highlight: '#FFC870',
            label: 'Yellow'
          }
        ];

        // Chart.js Options
        $scope.options = {

          // Sets the chart to be responsive
          responsive: true,

          //Boolean - Whether we should show a stroke on each segment
          segmentShowStroke: true,

          //String - The colour of each segment stroke
          segmentStrokeColor: '#fff',

          //Number - The width of each segment stroke
          segmentStrokeWidth: 2,

          //Number - The percentage of the chart that we cut out of the middle
          percentageInnerCutout: 50, // This is 0 for Pie charts

          //Number - Amount of animation steps
          animationSteps: 100,

          //String - Animation easing effect
          animationEasing: 'easeOutBounce',

          //Boolean - Whether we animate the rotation of the Doughnut
          animateRotate: true,

          //Boolean - Whether we animate scaling the Doughnut from the centre
          animateScale: false,

          //String - A legend template
          legendTemplate: '<ul class="tc-chart-js-legend"><% for (var i=0; i<segments.length; i++){%><li><span style="background-color:<%=segments[i].fillColor%>"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>'

        };
      }]);
</script>
</body>
</html>

如果您想要所有列宽,请执行以下操作:

// Attach event handler to listen to when column resize is finished.    
grid.attachEvent("onResize",function(cellIndex, colWidth){
    console.log("Now resizing col#" + cellIndex + " it is this wide: " + colWidth);
    return true;
});