News in versions: FastGrid 1.0, TreeGrid 17.0
FastGrid FastSheet ExamplesSamples DocumentationDoc Download Licensing Prices Buy Development
services
References References Contacts
TreeGrid Gantt chart SpreadSheet ExamplesSamples DocumentationDoc Download Licensing Prices Buy Contacts

1. Dragging and pasting rows

Dragging rows inside grid and between grids and copying & pasting rows via clipboard

Source: 01-Tree.js
Source: 01-Nodes.js
Source: 01-Items.js
  • Example description


    • Move row with children by dragging by left mouse button, copy row by dragging by shift+right mouse button, copy row with children by dragging by ctrl+right mouse button. Select more rows (by panel row panel button) and drag them together.
    • There are three row types (default rows), NODE, ITEM and SUBITEM. The NODE can contain only ITEM. The ITEM can contain ITEM and SUBITEM. The SUBITEM can contain only SUBITEM.
    • New child in NODE is ITEM. New child in ITEM is SUBITEM. New child in SUBITEM is SUBITEM.
    • The Tree and Nodes grids can contain all rows (NODE, ITEM, SUBITEM), root rows are NODE. The Items grid can contain ITEM and SUBITEM rows, root rows are ITEM. The Subitems grid does not accept new rows.
    • Rows dragged from Tree, Nodes and Items grids are moved (or copied if dragged by right or middle mouse button) and rows dragged from Subitems grid are always copied.
    • Rows are copied to clipboard always with children, preserves their tree structure and default rows.
    • To Tree are pasted rows fully with tree, before focused or in children of focused depending on default row of the copied rows.
    • To Nodes and Items are pasted only with appropriate default rows, NODE or ITEM, always before focused row.
    • All the grids share the same undo queue to correctly undo / redo the moves between grids.
  • Dragging


    Dragging rows in grid can be controlled by Cfg

    DraggingRows

    , it can permit or restrict dragging inside row part, between parts, between parts, etc.
    By which cell can be row caught and dragged is set by column attribute

    UseMove

    , by default set in column D: Header / Index.
    Dragging rows can be more controlled by Cfg

    MoveRowTypw

    and in tree by Cfg

    MoveRowTree

    .
  • Dropping permissions


    Dropping permissions are specified by parent row or row part

    Accept

    attribute. It specifies which rows can be dropped to children of the row or row part.
    The rows for the Accept are identified by row attribute

    DragId

    . By default all rows have set DragId = "Row and Accept = "Row".
    The Accept and DragId are usually set in row default, aassigned to row by

    D

    or parent

    CD

    attribute.
  • Copying rows to clipboard


    To copy whole rows to clipboard set

    Copying

    = 3.
    To copy required information for pasting restrictions use Cfg attribute

    CopyStyles

    with values like D or L. And set also

    CopyHtml

    = 1.
    In tree is possible to copy also parents and / or children of selected / focused rows adding Parent or Children to Cfg

    CopyPasteRowsType

    .
  • Pasting rows from clipboard


    To add new rows by pasting from clipboard, set Cfg

    PasteFillRows

    = 0,

    PasteAddRows

    = 2,

    PasteFillCols

    = 3 and optionally

    PasteFillSingle

    = 0.
    To use information copied for pasting restrictions use Cfg attribute

    PasteStyles

    with values like D or L. And set also

    PasteHtml

    = 1.
    To more control which rows are where pasted, use API event

    OnPaste

    , here is possible to move or delete the newly added rows.