cancel
Showing results for 
Search instead for 
Did you mean: 

How to make single table cell to be selected

Former Member
0 Kudos
273

In my scanerio:

there is a table, I want to let only one cell of this table to be selected, neither the whole row not the whole column,

It should look like only this single cell has the background color different from all other cells in this table.

I have tried to set the background of the celleditor as the value "marked1", my table celleditor is a TextView.

but the selected background color can not cover the whole table cell, it seems there is some cellpadding around the TableCellEdtior. I didn't find any place to set the cellpadding for the TableCellEditor.

Is there any solution, please kindly help me.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can create a contextAttribute of type boolean inside the same node to which table is bound and bind this attribute to the enable property of the particular cell .

Regards, Anilkumar

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Kevin,

AFIK it not possible to change the colour of the table cell. But you can change the tableCellEditor design so that user knows that he has already selected that row. In case of textView as table cell editor, you can create an attribute of type TextViewDesign from the local dictionary -> uielementdefinitions -> select TextViewDesign.

Now in the wdinit() set this as

ele.setDesign(WDTextViewDesign.STANDARD) 

for each table element.

In the onLeadSelect() action write this code

wdContext.nodeTableNode().getTableNodeElementAt(wdContext.nodeTableNode().getLeadSelection()).setDesign(WDTextViewDesign.<Choose whichever suits your requirement>)

Hope this helps.

Regards,

Jaydeep

Former Member
0 Kudos

Hi, jaydeep:

Thank you

I had tried this before, but the design for the textview is the font of the text, it's not the background,

Former Member
0 Kudos

Hi,

If you set "SelctionMode" to "None" then there is no way to know the table row selection.

Regards, Anilkumar

Former Member
0 Kudos

Hi,Anilkumar :

which row has been selection can be got in the webdypro program, i have tried.

but the there is no way to show which was selected. so I want to set the color of all cells of the selected row to show the user that this row was selected.

Former Member
0 Kudos

My original destination is:

I want a table without the selection column(at the left side of every table, there is a column for selection, only the block for mouse selection), when i set the property "selectionMode" to "node", this column disppeared, but when i click the one of row in the table, there is no change to display this row was selected.

So I want no selection column but when i click one row, the background color will changed to express that this row was selected. Is it possible?

I want to change the background of cell to reach that destination. But it seems doesn't work