How to dinamically change the properties of a aoColumn?

How to dinamically change the properties of a aoColumn?

RogerFordRogerFord Posts: 1Questions: 1Answers: 0

Hi all.
I must to create a table in which the first column must be editable (and include the Update and the Cancel buttons) for all the rows except the new ones. The new rows (created with the Add button) must be read-only.
I just tried a very simple work around but it doesn't work.

What I did was define by default:

...
"aoColumns": [
//typeCode
{
cssclass: "typeCodeTable",
indicator: "<img src='<%=Url.Content("~/Content/images/loadingIndicator_small.gif")%>'>",
event: "click",
submit: '<%= Resources.QTSCT.Update %>',
cancel: '<%= Resources.QTSCT.Cancel %>'
},
...

and then try to modify at the cell level the type as read-only on depending on a flag that I assing in the server code:

...
<% foreach (var item in Model.OperationTypes)
{ %>
<tr id="<%= item.Code %>">
<% if (item.newCode){%>
<td style="width: 75px"><%= item.Code %></td>
<%} else{ %>
<td class="read-only" style="width: 75px"><%= item.Code %></td>
<%} %>
...

But it looks like the attributes assigned in the initialization overwrite the ones assinged in the html directly.

Any suggestion?

Thank you in advance,

Roger Vives

This discussion has been closed.