cancel
Showing results for 
Search instead for 
Did you mean: 

How to disable selective cells in a column of a table?

former_member187658
Participant
0 Kudos

Hi

I have a Table UI element having 5 columns. 4 of this are non-editable and only one is editable i.e. having input field . The data is picked from the backend. The 5th column also gets default data from the backend, which the user can later on change.

But there is a condition, that only the input fields from that row onwards should remain enabled whose month field matches the current month. Rest all should become disabled or invisible.

I worte the code in the wdModifyView() which picks the current date, and then in a loop it checks all the rows for the condition. If it matches the condition, it comes out of the loop, else it sets the enable property of input field to false.

But when i run this application, all the cells become disabled, not selective cells.

Is there a way in which I can sort this problem, any API using which i can access each cell by its row number and column number and then disable it.

If anybody could please help, it is urgent.

Thanks & regards,

Anupreet

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Anupreet,

Create a subnode with cardinality 1..1 and boolean attribute IsEnabled right under your data node. Write a supply function for this subnode, and set boolean attribute value depending on month in parentElement (parameter of supply function). Then bind InputField "enabled" property to this boolean attribute.

VS

former_member187658
Participant
0 Kudos

Hi Valery

i tried similar thing, but it is not taking. it gives the error that due to model binding, you can't create any other attribute, right at the design time.

Former Member
0 Kudos

Yes, exactly.

Therefore I say "create sub-node and add attribute in sub-node". This is allowed.

VS