javascript - 如何使用 Wijmo 网格获取选择更改的对象值

标签 javascript angularjs angularjs-directive 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;

        });



    }
}

最佳答案

网格的“selection”属性返回包含所选内容的 CellRange 对象。它是一个获取/设置属性,因此您可以随时使用它来查找选择了哪些行和列,或者修改选择。

如果选择单个单元格,则该范围的“row”和“col”属性将包含所选行和列的索引。如果选择了范围,则可以使用范围“topRow”、“leftCol”、“bottomRow”和“rightCol”来获取范围。

此链接描述了 CellRange 对象的其他有用方法和属性:

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

关于javascript - 如何使用 Wijmo 网格获取选择更改的对象值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36545471/

相关文章:

javascript - 在 Arshaw FullCalendar 中更改时区

javascript - Angular Material 的 md-nav-bar 无法与 ui-router 一起正常工作

javascript - ionic http 获取本地文件给出 http 错误代码 0?

jQuery 函数不适用于 ng-repeat

javascript - 如何将焦点设置到 TextAngular 的 div

javascript - 我如何将 2 个不同的特殊字符视为与 jquery/javascript 相同的字符?

javascript - 在 Firefox 41 中获取鼠标坐标

javascript - 响应式 Adwords 广告

javascript - 如何通过 AngularJs 中的函数传播不断变化的范围变量?

javascript - 如何有条件地放置 AngularJS 指令?