on 05-06-2008 11:16 AM
Hi Experts,
I want implement the table with special requirement, Please let me know is it possible or not.
If possible, please let me know how can I implement it.
I want table with five rows and five columns.
I first column of every row, I want two buttons, with up arrow and down arrow.
When I click on that arrow , row should move up and down based on the arrow I have clicked.
How can I do this ?
Please help me.This is my client requirement.
Regards,
Naresh
You can't have two buttons in one column, but with two columns this can easily be achieved.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Say your table data source node is named "Rows".
Create an action "MoveRow", add two parameters
- row : IRowsElement
- up: boolean
"UpColumn" (TableColumn), editor = "Up" (Button), onAction = "MoveRow", parameter mapping = ("nodeElement" -> "row", "up" -> "true)
"DownColumn" (TableColumn), editor = "Down" (Button), onAction = "MoveRow", parameter mapping = ("nodeElement" -> "row", "up" -> "false)
Action handler:
void wdOnActionMoveRow(..., IRowsElement row, boolean up)
{
if (up)
{
if ( row.index() > 0 )
{
row.node().swapElements( row.index(), row.index() - 1 );
}
}
else
{
if ( row.index() < row.node().size() - 1 )
{
row.node().swapElements( row.index(), row.index() + 1 );
}
}
}
Additionally, I would create calculated attributes to disable the "Up"/"Down" buttons for the first/last table row.
Armin
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.