Repeater Command¶
Use this command for repeat collection of command for each item in related data source.
Note
The repeater
command inherit from CommandBase Class.
Important
The repeater
command an not be present as void command and must have child elements like command or html
.
Also name
attribute for repeater
command is required
.
1 2 3 | <basis core="repeater" datamembername="" >
[commands]
</basis>
|
Attributes¶
- datamembername
string
required
[##-notation
Determine data source name that serve to get source data for use in rendering process. For more information see Data Binding
Remarks¶
The repeater
command ues for implement for
statements of Control Flow in rendering process.
In fact this command repeat execution of one or more specific command for each data item presented in specified data source.
Note
For more information about control flow, visit Wiki/ControlFlow.
See example below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | <table>
<thead>
<tr>
<td>
First Name
</td>
<td>
Last Name
</td>
</tr>
</thead>
<tbody>
<basis core="repeater" name="rep" datamembername="db.users" >
<basis core="print" datamembername="rep.current">
<face>
<tr>
<td>
@fname
</td>
<td>
@lname
</td>
</tr>
</face>
</basis>
</basis>
</tbody>
</table>
|
Data source db.users
is:
id |
managerid |
fname |
lname |
team-name |
---|---|---|---|---|
1 |
-1 |
s.alireza |
qamsari |
team-a |
2 |
1 |
amir |
jalali |
team-b |
3 |
1 |
akbar |
karimi |
team-a |