samedi 21 février 2015

How to make a javascript multiple if

I have an Obout Grid created, and in a column I want to evaluate that if it is "EN" it puts "Enfermedad", if it is "RE" it puts "Reglamentaria" and if it is "ES" it puts "Estudio"


This is where is done: <%# (Container.Value == "S" ? "Si" : "No")%>


And the full code is this:



<cc1:Grid ID="GridPendientes" runat="server" AllowPageSizeSelection="False" AllowSorting="False" AutoGenerateColumns="False" FolderStyle="styles/style_8" Language="es" Width="600" AllowAddingRecords="False" AllowMultiRecordSelection="false">
<ScrollingSettings ScrollHeight="150" />
<Columns>
<cc1:Column ID="ClmCodFeriado" DataField="codLicencia" HeaderText="Codigo" Visible="false" Index="0" />
<cc1:Column ID="ClmFechaDesde" Width="108" HeaderText="Fecha Desde" DataFormatString="{0:dd/MM/yyyy}" DataField="fechaDesdeLicencia" Index="1" Visible="true" Wrap="True" />
<cc1:Column ID="ClmFechaHasta" Width="108" HeaderText="Fecha Hasta" DataFormatString="{0:dd/MM/yyyy}" DataField="fechaHastaLicencia" Index="2" Visible="true" Wrap="True" />
<cc1:Column ID="ClmNroDias" Width="90" DataField="cantDiasLicencia" HeaderText="Cant. Días" Visible="true" Index="3" ></cc1:Column>
<cc1:Column ID="ClmTipoLic" Width="128" DataField="codTipoLicencia" HeaderText="Tipo" Visible="true" Index="4" >
<TemplateSettings TemplateId="TemplateTipoLic" />
</cc1:Column>
<cc1:Column ID="ClmDescrip" Width="280" DataField="descripLicencia" HeaderText="Descripción" Visible="true" Index="5" ></cc1:Column>
</Columns>
<Templates>
<cc1:GridTemplate runat="server" ID="TemplateTipoLic">
<Template>
<%# (Container.Value == "S" ? "Si" : "No")%>

</Template>
</cc1:GridTemplate>
</Templates>
</cc1:Grid>

Aucun commentaire:

Enregistrer un commentaire