|
Show example
|
- By default are all cells editable. You can suppress editing for whole grid by <Cfg
Editing='0'>.
Or you can suppress editing for column, row or cell by setting appropriate CanEdit attribute to 0.
- Basic types for editing are
Text,
Int,
Float
are edited in <input> textbox,
Date
is edited in <input> textbox with possibility to show calendar,
Enum
is edited in <select> and
Bool
is edited by checkbox.
- For number formats (Int, Float and Date) you can set advanced options in
EditFormat attribute.
See TreeGrid cell formats.
- The items (options) of Enum type are set by
Enum attribute,
the indexes higher then items count are displayed as integer and formatted by
IntFormat attribute.
- See in example, there are various edit formats in cells.
- For number formats are also permitted only some keys when editing - digits and separators.
- By default grid does not handle empty values for number and date types, you can change this behavior by <Cfg> attributes
EmptyNumber and
EmptyDate.
- Editing you can control dynamically by JavaScript API events
OnStartEdit and
OnEndEdit.
Also cell types and permissions you can control in events
OnCanEdit,
OnGetType,
OnGetFormat,
OnGetEnum.
|
Show data source
<Grid>
<Cfg id='Editing1' Sorting='0'
CanEmpty='1' EmptyValue='- empty -' />
<Cols>
<C Name='A' Type='Text'/>
<C Name='B' Type='Int'/>
<C Name='C' Type='Float'/>
<C Name='D' Type='Date' Width='90'/>
<C Name='E' Type='Date' Button='None'
Format='HH:mm:ss'/>
<C Name='F' Type='Enum'
Enum='|one|two|three'
IntFormat='(##)'/>
<C Name='G' Type='Bool'/>
</Cols>
<Header A='Text' B='Int' C='Float'
D='Date' E='Date' F='Enum' G='Bool'/>
<Body>
<B>
<I/>
<I A='Text 1' B='0' C='3.14'
D='1/1/2000' E='10:12:30' F='0'
G='0'/>
<I A='Text 2'
B='20' BEditFormat='000'
C='7' CEditFormat='000'
D='12/31/2005' DEditFormat='MM/dd'
E='4:15' EEditFormat='H:mm'
F='1' G='1' GCanEdit='0'/>
<I A='Text 3' ACanEdit='0' B='-3'
C='-13.256' CEditFormat='0.0000'
D='7/12/1900' DButton='None'
DEditFormat='M/d/yyyy'
E='23:59:59' EEditFormat='HH:mm'
F='2' FCanEdit='0' G='1'/>
<I A='Text 4' B='1234'
C='0.032' CEditFormat='00.000'
D='5/20/2010' DEditFormat='M/d/yy'
E='00:00:00' EEditFormat='H:m:s'
F='8' G='0'/>
</B>
</Body>
</Grid>
|