I have a grid from obout:
<cc1:Grid ID="GridEvalEmp" runat="server" AllowPageSizeSelection="False" AllowPaging="True" PageSize="10"
AutoGenerateColumns="False" FolderStyle="styles/style_8" Language="es"
Width="600" AllowFiltering="false">
<ClientSideEvents OnClientCallbackError="onGridErrorEval" OnClientAdd="onAddEvalEmp" OnClientEdit="onEditEvalEmp"
OnBeforeClientInsert="validarFechas" OnBeforeClientUpdate="validarFechas"/>
<Columns>
<cc1:Column ID="ClmCodEval" DataField="codEvaluacion" HeaderText="Capacitación" Visible="false" Index="0" />
<cc1:Column ID="ClmNombreCapacitacion" Width="300" HeaderText="Capacitación" DataField="nombreEvaluacion" Index="1" Visible="true" Wrap="True" />
<cc1:Column ID="ClmFechaActEval" Width="180" HeaderText="Fecha de Evaluación" DataFormatString="{0:dd/MM/yyyy}" DataField="fechaEvaluacion" Index="2" Visible="true" Wrap="True" />
<cc1:Column ID="ClmPuntaje" Width="200" HeaderText="Puntaje" DataField="puntajeEval" Index="3" Visible="true" Wrap="True" />
<cc1:Column ID="ClmEditCap" Width="160" AllowDelete="false" AllowEdit="true" HeaderText="" Index="3" />
</Columns>
</cc1:Grid>
I want to disable the ClmPuntaje column on client add. For that I have a javascript function but it doesn't work:
function onAddEvalEmp(record) {
document.getElementById('ClmPuntaje').disabled = true;
}
How can I make this work?
Thanks! Sabrina
Acutally, the Id is not 'ClmPuntaje' when you try to view the souce code for the page. You might get the real Id then the javascript would work. Disabling the whole column is simple via jquery,
Then, try: $(".Class1")" to identify the elements you want to disable.