Hello just to ask how I can make this work?I want to compare dates and color according to the criteria.
I share the code:
<ej:Grid ID="FlatGrid" runat="server" AllowSelection="True" AllowFiltering="True"
Locale="es-ES" AllowGrouping="True" AllowTextWrap="True" DataSourceCachingMode="Session"
EnableRowHover="true" AllowCellMerging="True" AllowPaging="True" AllowReordering="True"
AllowResizeToFit="True" AllowResizing="True" AllowSearching="True" AllowSorting="True"
AllowMultiSorting="True">
<ToolbarSettings ShowToolbar="true" ToolbarItems="printGrid"/>
<ContextMenuSettings EnableContextMenu="true"/>
<ClientSideEvents QueryCellInfo="formatingCell" />
<Columns>
<ej:Column DataType="number" Field="idfechas IsIdentity="True" IsPrimaryKey="True" HeaderText="ID" Width="45"/>
<ej:Column DataType="date" Field="fecha1" HeaderText="fecha 1" Width="85"/>
<ej:Column DataType="date" Field="fecha2" HeaderText="fecha 2" Width="85"/>
</Columns>
<PageSettings Template="" PageSize="10"></PageSettings><EditSettings RowPosition="Bottom" AllowAdding="True" AllowDeleting="false"/>
<FilterSettings FilterType="Excel" MaxFilterChoices="100" ShowPredicate="True" StatusBarWidth="10"/>
<ScrollSettings Width="950" Height="300" VirtualScrollMode="Continuous" />
</ej:Grid>
<script type="text/javascript">
function formatingCell(args) {
var a = 3;
var value = args.text.replace(",", "");
var $element = $(args.cell);
switch (args.column.headerText) {
case "fecha 2":
if (Date.parse(value) > Date.parse(args.column.headerText = "fecha 1".value))
$element.css("background-color", "#336c12").css("color", "white");
I hope that they can help me thanks in advance.