【问题标题】:How to apply grid item header handle to angular2-grid?如何将网格项目标题句柄应用于 angular2-grid?
【发布时间】:2016-12-09 15:01:28
【问题描述】:

我正在使用来自https://github.com/BTMorton/angular2-grid 的示例代码。

但是,如演示 (https://bmorton.co.uk/angular/) 中所示,您只能使用蓝色列标题句柄而不是整个网格项来拖动网格项。

如何实现这样的功能?

干杯 卫生巾

【问题讨论】:

    标签: angular


    【解决方案1】:

    你可以这样写:

    <div [ngGrid]="gridConfig">
        <div [ngGridItem]="{'dragHandle': '.handle', 'fixed': true, 'col': 2, 'row': 1}">
            <div class="handle">{{text}}</div>
        </div>
    </div>
    

    通知dragHandle属性

    另见对应plunkrhttps://plnkr.co/edit/gKEBR7iaurN8aI04g9bU?p=preview

    【讨论】:

    • 感谢您的回复。我可以将第一个网格项目拖到第二个吗?我正在尝试从一个可以看到小图标的地方实现类似 Visual Studio 工具箱的功能;拖到工作空间区域给我细节功能。在这方面的任何投入都会很有帮助。
    【解决方案2】:

    您可以按照以下属性来理解模块:

    {
    'col': 1,               //  The start column for the item
    'row': 1,               //  The start row for the item
    'sizex': 1,             //  The start width in terms of columns for the item
    'sizey': 1,             //  The start height in terms of rows for the item
    'dragHandle': null,     //  The selector to be used for the drag handle. If null, uses the whole item
    'resizeHandle': null,   //  The selector to be used for the resize handle. If null, uses 'borderSize' pixels from the right for horizontal resize, 
                            //    'borderSize' pixels from the bottom for vertical, and the square in the corner bottom-right for both
    'borderSize': 15,
    'fixed': false,         //  If the grid item should be cascaded or not. If yes, manual movement is required
    'draggable': true,      //  If the grid item can be dragged. If this or the global setting is set to false, the item cannot be dragged.
    'resizable': true       //  If the grid item can be resized. If this or the global setting is set to false, the item cannot be resized.
    }
    

    对于您的问题,请注意保留'dragHandle': null 可以满足您的需求。 希望这会有所帮助。

    【讨论】:

    • 感谢您的回复。我可以将第一个网格项目拖到第二个吗?我正在尝试从一个可以看到小图标的地方实现类似 Visual Studio 工具箱的功能;拖到工作空间区域给我细节功能。在这方面的任何投入都会很有帮助。
    猜你喜欢
    • 2017-12-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-21
    相关资源
    最近更新 更多