TreeGrid v6.0

Panel type

TreeGrid documentation index

 

Panel type displays one or more clickable icon buttons in one cell.

 

<C> <cell>                     string    Type             [“Panel”]             Type=”Panel”                                                                                                 .

To define Panel type, set column or cell attribute Type to “Panel”.

 

Standard fast panel

Every grid has predefined one Panel type always displayed on grid left side.

You cannot move this column, but you can hide it and define another panel(s) placed in another position (set <Panel Visible=’0’/>).

To not let user to show the panel from menu set <Panel Visible=’0CanHide=’0’/>

The default panel is defined by XML root tag <Panel>.

Grid can have more standard panels.

 

<Panel> <C>                 bool       Move           [0]                                                                                                                                              .

If the default Panel button Move is visible. This button is hidden also if <Cfg Dragging=”0”/>. This button is inactive when the row has CanDrag=’0’.

Dragging this button moves the row. Use this button if dragging row by cells has different function like selecting cells.

 

<Panel> <C>                 bool       Select         [1]                                                                                                                                              .

If the default Panel button Select is visible. This button is hidden also if <Cfg Selecting=”0”/>. This button is inactive when the row has CanSelect=’0’.

Click to this button selects the whole row. Dragging this button selects rows range.

 

<Panel> <C>                 bool       Delete         [1]                                                                                                                                              .

If the default Panel button Delete is visible. This button is hidden also if <Cfg Deleting=”0”/>. This button is inactive when the row has CanDelete=’0’.

Click to this button deletes row or undeletes deleted row.

 

<Panel> <C>                 bool       Copy            [0]                                                                                                                                 upd 6.0 .

If the default Panel button Copy is visible. This button is hidden also if <Cfg Copying=”0”/>. This button is inactive when the row has CanCopy=’0’.

Click to this button shows popup menu for copying and adding rows. The menu is defined by attribute CopyMenu.

 

<Cfg>                              bool       FastPanel            [1]                                                                                                                    new 6.0 .

For 1 it displays standard panel as one image to speed rendering up.

For 0 it displays all icons separately, the advantages are:

the panel width does not need to be exact

images in gif can be easily changed

when used panel background (styles Modern and Borders), the hover of panel works correctly

 

Custom panel

Panel can contain one or more custom buttons set in cell value or by Buttons attribute.

You can specify the custom button name in value or Buttons and set its parameters as separate attributes.

The custom button name is set as xxx in the next documentation.

 

<C>                                 string[ ] Buttons                                                                                                                           new 6.0;upd 6.4.

Comma separated list of buttons on panel.

One panel button can be one of predefined buttons Move, Select, Delete, Copy or any custom button name.

(new 6.4) If button name is set to Empty or to empty string, empty space is shown instead of button, EmptyWidth pixels wide

For example <C Name=’Col1’ Buttons=’Select,Add,Delete,Edit’ Add=’Add.gif’ Edit=’../Icons/Edit.gif’ EditWidth=’20’ />

 

<cell>                             string[ ] value                                                                                                                                   new 6.0;upd 6.4.

Comma separated list of buttons on panel.

One panel button can be one of predefined buttons Move, Select, Delete, Copy or any custom button name.

(new 6.4) If button name is set to Empty or to empty string, empty space is shown instead of button, EmptyWidth pixels wide

For example <I Col1Panel=’Select,Add,Delete,Edit’ Col1Add=’Add.gif’ Col1Edit=’../Icons/Edit.gif’ Col1EditWidth=’20’/>

 

<C> <cell> <Panel>      string    xxx                                                                                                                                                      new 6.0 .

Image url for the custom panel button.

If this attribute is missing, the custom panel button is displayed as <button> tag with caption xxx. You should not combine images and buttons in one panel.

 

<C> <cell> <Panel>      int          xxxWidth            [from Grid.css]                                                                                               new 6.0 .

Width of the custom panel button

Default value is set in Grid.css, class GxPanelSelect.

 

<XML event>                 void       OnClickPanelxxx     (TGrid Grid, TRow Row, string Col, TEvent Event)               new 6.0 .

Standard column, row, cell or Actions attribute containing JavaScript code.

It is called on click to the cell part, panel button

It is standard TreeGrid mouse event, here is just mentioned to not forget its possibility when handling Panel button clicks.

Example: <I Col1=’Add,Select’ Add=’Add.gif’ Col1OnClickPanelAdd=’alert(“clicked add in column ”+Col);’/>

 

<XML event>                 void       OnClickHeaderxxx (TGrid Grid, TRow Row, string Col, TEvent Eventnew 6.0 .

The OnClickPanelxxx replacement for Header row.

 

<XML event>                 void       OnClickSpacexxx                (TGrid Grid, TRow Row, string Col, TEvent Event)   new 6.0 .

The OnClickPanelxxx replacement for Space row.

 

<C> <cell> <Panel>      string    PanelxxxTip                                                                                                                            new 6.0 .

Tooltip text for panel button.

 

<C> <cell> <Panel>      string    HeaderxxxTip                                                                                                                       new 6.0 .

Tooltip text for panel button in Header row

 

<C> <cell> <Panel>      string    SpacexxxTip                                                                                                            new 6.0 .

Tooltip text for panel button in Space row.

 

<C> <cell> <Panel>      string    PanelxxxCursor       [“pointer”]                                                                                           new 6.0 .

Mouse cursor displayed on mouse hover panel button.

It can be standard CSS cursor name: auto, crosshair, default, pointer, move, e-resize, ne-resize, nw-resize, n-resize, se-resize, sw-resize, s-resize, w-resize, text, wait, help

It works only for image buttons, not for <button>.

 

<C> <cell> <Panel>      string    HeaderxxxCursor   [“pointer”]                                                                                           new 6.0 .

The PanelxxxCursor replacement for Header row.

 

<C> <cell> <Panel>      string    SpacexxxCursor     [“pointer”]                                                                                           new 6.0 .

The PanelxxxCursor replacement for Space row.

 

<C> <cell> <Panel>      string    Formula                                                                                                                                                   .

Standard Formula attribute for Calculated row, here is stated just to not forget its advantage for Panel buttons.

The formula can return a comma separated list of the panel buttons for the row – you can return different buttons lists according to various formula sources.