|
Show example
|
- Special space rows Group, Search and Toolbar
you can create also manually by Space row.
- You can do it to merge functionality of the special rows to one row or to extend their functionality.
- You can also learn here, how to define Space row cells, especially Actions and Formulas.
- In example is always the first special row and next bellow is the same row done by Space row.
- All functionality can repeated except <Toolbar> resize button functionality and TreeGrid link look.
|
Show data source
<Grid>
<Cfg id="Expert9" ResizingMain='3' GroupMain='A' ConstHeight="1" SaveAttrs="S5,List,S5a,List" />
<Cols>
<C Name="id" Type="Text"/>
<C Name="A" Type="Text"/>
<C Name="B" Type="Text"/>
<C Name="C" Type="Float"/>
<C Name="D" Type="Enum" Enum="|Zero|One|Two|Three|Four|Five|Six|Seven|Eight|Nine|Ten"/>
<C Name="E" Type="Date"/>
</Cols>
<Header
id="id"
A="Text1"
B="Text2"
C="Float"
D="Enum"
E="Date"
/>
<Body>
<B>
<I id="r01" A="James Smith" B="Paris" C="10.3" D="1" E="1/1/2000"/>
<I id="r02" A="Mark Jones" B="London" C="12" D="2" E="6/25/2007"/>
<I id="r03" A="Eric Walker" B="Berlin" C="-10.3" D="1" E="1/1/2000"/>
<I id="r04" A="James King" B="London" C="1200" D="6" E="12/31/1999"/>
<I id="r05" A="Henry Smith" B="Rome" C="0.03" D="8" E="6/24/2007"/>
<I id="r06" A="Carl Hill" B="Paris" C="12.45" D="0" E="4/8/2004"/>
<I id="r07" A="Mark Brown" B="Lisboa" C="0.345" D="10" E="10/20/2001"/>
<I id="r08" A="Joe Walker" B="Berlin" C="-12" D="3" E="10/20/2001"/>
<I id="r09" A="Eric Jones" B="Prague" C="-0.345" D="4" E="4/16/1994"/>
<I id="r10" A="James Smith" B="New York" C="4560" D="10" E="6/25/2007"/>
<I id="r11" A="Jack Reed" B="Madrid" C="1200" D="2" E="4/13/2010"/>
<I id="r12" A="Mark Brown" B="Budapest" C="10.3" D="7" E="5/6/2002"/>
<I id="r13" A="Jack Rogers" B="Moscow" C="12" D="1" E="2/18/1999"/>
<I id="r14" A="James Davis" B="Prague" C="-0.345" D="9" E="4/12/2006"/>
<I id="r15" A="Fred James" B="Moscow" C="12.46" D="9" E="3/25/2005"/>
<I id="r16" A="Billy Smith" B="Rome" C="-1200" D="2" E="1/24/2000"/>
</B>
</Body>
<Solid>
<Group
List='|None|Text2|Enum|Text->Enum|Enum->Text2'
ListCustom='Unknown'
Cols='||B|D|B,D|D,B'
Types='||0|0|0|0'
Custom='1'
/>
<I Cells='Check,List,Custom' Space='1' NoColor='1' CanFocus='0'
CheckType="Bool" CheckFormula="Grid.Grouped" CheckOnClick="Grid.Grouped?GroupOff:GroupOn" CheckWidth="14" CheckCanEdit="1"
ListType='Select'
ListDefaults='|None|Text2|Enum|Text->Enum|Enum->Text2'
ListOnChange='Grid.GroupRows(["","B","D","B,D","D,B"][Grid.GetDefaultsIndex(Row,Col)]);'
ListFormula='choose(Grid.Group,["","B","D","B,D","D,B"],null,"Unknown")'
CustomType='DropCols'
CustomText='To group by drag column caption here ...'
CustomOnChange='Grid.GroupRows(Row[Col])'
CustomFormula='Grid.Group'
CustomRelWidth='1'
/>
<Search id="S1" Space="4" Cells="Expression" ExpressionAction="Filter" Panel="0"/>
<I id="S1a" Space="4" Cells="Expression" NoColorState="1"
ExpressionType="Text"
ExpressionRelWidth="1"
ExpressionOnChange="Grid.SearchExpression=Value;Grid.SearchRows('Filter');"
ExpressionFormula="Grid.SearchExpression?Grid.SearchExpression:''"
ExpressionCanEdit='1'
/>
<Search id="S2" Space="4" Cells="Expression,Filter,Select,Mark,Find,Clear,Help"/>
<I id="S2a" Space="4" Cells="Check,Expression,Filter,Select,Mark,Find,Clear,Help" NoColorState="1"
CheckType="Bool" CheckFormula="Grid.Searched" CheckOnClick="Grid.Searched?SearchOff:SearchOn" CheckWidth="14" CheckCanEdit="1"
ExpressionType="Text"
ExpressionRelWidth="1"
ExpressionOnChange="Grid.SearchExpression=Value;Grid.SearchRows('Refresh')"
ExpressionFormula="Grid.SearchExpression?Grid.SearchExpression:''"
ExpressionCanEdit='1'
FilterType="Button" FilterWidth="45"
FilterButtonText="Filter" FilterButton="Button"
FilterOnClick="Grid.SearchRows('Filter');"
FilterFormula="Grid.SearchAction=='Filter'"
SelectType="Button" SelectWidth="45"
SelectButtonText="Select" SelectButton="Button"
SelectOnClick="Grid.SearchRows('Select');"
SelectFormula="Grid.SearchAction=='Select'"
MarkType="Button" MarkWidth="45"
MarkButtonText="Mark" MarkButton="Button"
MarkOnClick="Grid.SearchRows('Mark');"
MarkFormula="Grid.SearchAction=='Mark'"
FindType="Button" FindWidth="45"
FindButtonText="Find" FindButton="Button"
FindOnClick="Grid.SearchRows('Find');"
FindFormula="Grid.SearchAction=='Find'"
ClearType="Button" ClearWidth="45"
ClearButtonText="Clear" ClearButton="Button"
ClearOnClick="Grid.SearchRows('Clear');"
HelpType="Button" HelpWidth="45"
HelpButtonText="Help" HelpButton="Button"
HelpOnClick="Grid.SearchRows('Help');"
/>
<Search id="S3" Space="4" Cells="Expression,Actions,Search,Clear" ExpressionLeft="3" ActionsLeft='3' Panel="0"/>
<I id="S3a" Space="4" Cells="Expression,Actions,Search,Clear"
ExpressionLeft="3"
ExpressionType="Text"
ExpressionRelWidth="1"
ExpressionColor="255,255,254"
ExpressionOnChange="Grid.SearchExpression=Value;"
ExpressionFormula="Grid.SearchExpression?Grid.SearchExpression:''"
ExpressionCanEdit='1'
ActionsLeft='3'
ActionsType="Select"
ActionsDefaults="|Filter|Select|Mark|Find"
Actions="Filter"
SearchType="Button"
SearchButton="Button"
SearchButtonText="Search"
SearchOnClick="Grid.SearchRows(Actions);"
SearchFormula="Grid.SearchAction==Actions"
ClearType="Button" ClearWidth="45"
ClearButton="Button"
ClearButtonText="Clear"
ClearOnClick="Grid.SearchRows('Clear');"
NoColorState="1"
/>
<Search id="S4" Space="4" Cells="Cols,Case,Type" Panel="0" CanFocus="0"
ColsLabel="Columns"
ColsDefaults="|All|Text1|Text2|Text1 &amp; Text2|Float|Enum|Date"
ColsCols="||A|B|A,B|C|D|E"
ColsToolTip="Searches only in selected columns"
CaseLabel="Case sensitive"
TypeLabel="Search in cells"
/>
<I id="S4a" Space="4" Cells="Cols,Case,Type" NoColor="1" CanFocus="0"
ColsLabel="Columns"
ColsType="Select"
ColsDefaults="|All|Text1|Text2|Text1 &amp; Text2|Float|Enum|Date"
ColsOnChange="Grid.SearchCols = ['','A','B','A,B','C','D','E'][Grid.GetDefaultsIndex(Row,Col)];Grid.SearchRows('Refresh');"
ColsFormula="choose(Grid.SearchCols?Grid.SearchCols:'',['','A','B','A,B','C','D','E'])"
ColsWidth="100"
ColsTip="Searches only in selected columns"
CaseLabel="Case sensitive"
CaseType="Bool"
CaseWidth="-1"
CaseOnChange="Grid.SearchCaseSensitive=Value;Grid.SearchRows('Refresh');"
CaseFormula="Grid.SearchCaseSensitive?1:0"
CaseCanEdit="1"
TypeLabel="Search in cells"
TypeLabelCanFocus="0"
TypeLabelWidth="-1"
TypeLabelNoColor="1"
TypeType="Bool"
TypeWidth="-1"
TypeOnChange="Grid.SearchCells=Value;Grid.SearchRows('Refresh');"
TypeFormula="Grid.SearchCells?1:0"
TypeTip="Searches only in cells, only for Mark and Find action"
TypeCanEdit="1"
/>
<Search id="S5" Space="4" Cells="List,Actions"
ListWidth="150"
ListDefaults="|None|This year|Last year|April|Positive float|Rome|London or Paris|James from London|Eight or less then four"
ListExpressions="@@Date>=1/1/2007 AND Date<1/1/2008@Date>=1/1/2006 AND Date<1/1/2007@(new window.Date(Date)).getMonth()==3@Float>=0@Text2 = Rome@Text2==London or Text2==Paris@Text2==London and Text1 starts James@Enum==8 || Enum<4"
ActionsAction="Refresh"
/>
<I id="S5a" Space="4" Cells="Check,List,Actions" CanFocus="0"
CheckType="Bool" CheckFormula="Grid.Searched" CheckOnClick="Grid.Searched?SearchOff:SearchOn" CheckWidth="14" CheckCanEdit="1"
ListType="Select" ListWidth="150"
ListDefaults="|None|This year|Last year|April|Positive float|Rome|London or Paris|James from London|Eight or less then four"
ListOnChange="Grid.SearchExpression = [
'',
'Date>=1/1/2007 AND Date<1/1/2008',
'Date>=1/1/2006 AND Date<1/1/2007',
'(new window.Date(Date)).getMonth()==3',
'Float>=0',
'Text2 = Rome',
'Text2==London or Text2==Paris',
'Text2==London and Text1 starts James',
'Enum==8 || Enum<4'
][Grid.GetDefaultsIndex(Row,Col)];
Grid.SearchRows(Actions)"
ActionsType="Select"
ActionsDefaults="|Filter|Select|Mark|Find"
Actions="Filter"
NoColorState="1"
/>
<I id='S6a' Space='4' CanEdit='0' CanFocus='0' CanPrint='0'
Cells="Save,Reload,Repaint,Print,Export,Add,AddChild,Sort,Calc,ExpandAll,CollapseAll,Columns,Cfg,Help,Debug,StyleTitle,StyleStandard,StyleLight,StyleOffice,StyleModern,StyleBorders,StyleRobust,StylePlain,Empty,Formula,Resize"
SaveType="Button" SaveOnEnter="Validate AND Save" SaveVisibleFormula="(Grid.Data.Upload.Url || Grid.Data.Upload.Tag) && !Grid.Detail?1:0"
ReloadType="Button" ReloadOnEnter="Reload" ReloadVisibleFormula="!Grid.Detail"
RepaintType="Button" RepaintOnEnter="Repaint" RepaintVisibleFormula="Grid.Paging&&Grid.AllPages"
PrintType="Button" PrintOnEnter="Print"
ExportType="Button" ExportOnEnter="Export" ExportVisibleFormula="!!Grid.Data.Export.Url"
AddType="Button" AddOnEnter="CopyMenuF OR AddRowF OR AddRowEnd" AddVisibleFormula="Grid.Adding"
AddCopyMenu="CopyRow,CopyTree,CopyEmpty,CopySelected,CopySelectedTree,CopySelectedEmpty,CopySelectedEnd,CopySelectedTreeEnd,CopySelectedEmptyEnd,AddRow,AddRowEnd"
AddChildType="Button" AddChildOnEnter="CopyMenuF OR AddChildEndF" AddChildVisibleFormula="Grid.Adding && !!Grid.MainCol"
AddChildCopyMenu="CopySelectedChildEnd,CopySelectedTreeChildEnd,CopySelectedEmptyChildEnd,AddChildEnd"
SortType="Button" SortOnEnter="SortOn OR SortOff" SortVisibleFormula="Grid.Sorting" SortFormula="Grid.Sorted"
CalcType="Button" CalcOnEnter="CalcOn OR CalcOff" CalcVisibleFormula="Grid.Calculating" CalcFormula="Grid.Calculated"
ExpandAllType="Button" ExpandAllOnEnter="ExpandAllLoaded" ExpandAllVisibleFormula="!!Grid.MainCol"
CollapseAllType="Button" CollapseAllOnEnter="CollapseAll" CollapseAllVisibleFormula="!!Grid.MainCol"
ColumnsType="Button" ColumnsOnEnter="ShowColumns"
CfgType="Button" CfgOnEnter="ShowCfg"
HelpType="Button" HelpOnEnter="ShowHelp"
DebugType="Button" DebugOnEnter="ShowDebug" DebugVisibleFormula="!!Grid.DebugFlags.length"
StyleTitle="<span style='color:#999;'>Style:</span>" StyleTitleWidth="-2" StyleTitleType="Html" StyleTitleNoColor="1" StyleTitleCanFocus="0"
StyleStandardType="Button" StyleStandardIcon="Standard" StyleStandardSwitch="1"
StyleStandardFormula="Grid.Style=='GS'" StyleStandardOnClick="Grid.SetStyle('GS',0,1)" StyleStandardOnEnter="Grid.SetStyle('GS',0,1)"
StyleLightType="Button" StyleLightIcon="Light" StyleLightSwitch="1"
StyleLightFormula="Grid.Style=='GL'" StyleLightOnClick="Grid.SetStyle('GL',0,1)" StyleLightOnEnter="Grid.SetStyle('GL',0,1)"
StyleOfficeType="Button" StyleOfficeIcon="Office" StyleOfficeSwitch="1"
StyleOfficeFormula="Grid.Style=='GO'" StyleOfficeOnClick="Grid.SetStyle('GO',0,1)" StyleOfficeOnEnter="Grid.SetStyle('GO',0,1)"
StyleModernType="Button" StyleModernIcon="Modern" StyleModernSwitch="1"
StyleModernFormula="Grid.Style=='GM'" StyleModernOnClick="Grid.SetStyle('GM',0,1)" StyleModernOnEnter="Grid.SetStyle('GM',0,1)"
StyleBordersType="Button" StyleBordersIcon="Borders" StyleBordersSwitch="1"
StyleBordersFormula="Grid.Style=='GB'" StyleBordersOnClick="Grid.SetStyle('GB',0,1)" StyleBordersOnEnter="Grid.SetStyle('GB',0,1)"
StyleRobustType="Button" StyleRobustIcon="Robust" StyleRobustSwitch="1"
StyleRobustFormula="Grid.Style=='GR'" StyleRobustOnClick="Grid.SetStyle('GR',0,1)" StyleRobustOnEnter="Grid.SetStyle('GR',0,1)"
StylePlainType="Button" StylePlainIcon="Plain" StylePlainSwitch="1"
StylePlainFormula="Grid.Style=='GP'" StylePlainOnClick="Grid.SetStyle('GP',0,1)" StylePlainOnEnter="Grid.SetStyle('GP',0,1)"
EmptyRelWidth="1" EmptyNoColor="1"
FormulaWidth="-2" FormulaNoColor="1" FormulaCanFocus="0" FormulaType="Html" FormulaWrap="0"
FormulaFormula='countrows()+" rows"'
ResizeWidth="7" ResizeType="Html"
/>
</Solid>
<Toolbar
Formula='countrows()+" rows"'
/>
</Grid>
|