cancel
Showing results for 
Search instead for 
Did you mean: 

Table with special requirement

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

You can't have two buttons in one column, but with two columns this can easily be achieved.

Armin

Former Member
0 Kudos

Hi Armin,

Thanks for your reply.

Can you please explain, how it is ?

But if I do it with two columns, then how come they will associate for one row ?

Based the arrow clicked I want that perticular row should go either UP or DOWN.

Can please explain.

Thanks in advance.

Regards,

Naresh

Former Member
0 Kudos

Is it possible in PDK, for TableView ?

Former Member
0 Kudos

Hi,

But if I do it with two columns, then how come they will associate for one row ?

as they are part of the same row what is the problem if they exists in two columns.

Based the arrow clicked I want that perticular row should go either UP or DOWN.

swap the elements

Regards

Ayyappparaj

Former Member
0 Kudos

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

Former Member
0 Kudos

HI Armin,

Thank you very much.

Regards,

Naresh