2016-04-11 83 views
0

ここで私はwijmoグリッドと同じディレクティブを作成しました。ここで私の問題は選択された行の値を取得できません。事前に おかげ選択の仕方wijmoグリッドを使用してオブジェクト値を変更しました

sample code for wijmo grid

app.directive('customFlexGrid', function ($compile) { 
return { 
    restrict: 'E', 
    template: '<div/>', 
    replace: true, 
    scope: { 
     itemsSource: '=', 
     gridheader: '='  

    }, 
    link: function (scope, element, attrs) { 
     var grid = new wijmo.grid.FlexGrid(element[0]); 

     scope.$watch('itemsSource', function() { 

      grid.itemsSource = scope.itemsSource; 
      grid.columns[1].width = 300; 
      grid.selectionMode= "Row"; 
      grid.isReadOnly=true; 

     }); 



    } 
} 

答えて

1

グリッドの「選択」プロパティは、選択が含まれてはCellRangeオブジェクトを返します。これはget/setプロパティなので、いつでも使用して、選択されている行と列を調べたり、選択を変更することができます。

単一のセルが選択されている場合、範囲の「行」プロパティと「列」プロパティには、選択した行と列のインデックスが含まれます。範囲が選択されている場合は、範囲を取得するために範囲「topRow」、「leftCol」、「bottomRow」、および「rightCol」を使用できます。

このリンクをクリックするとはCellRangeオブジェクトの他の有用なメソッドとプロパティを説明:

https://wijmo.com/5/docs/topic/wijmo.grid.CellRange.Class.html

関連する問題