<ej:Grid ID="OrdersGrid" ClientIDMode="Static" runat="server" AllowSorting="True" AllowPaging="True" AllowGrouping="true">
. . .
<Columns>
. . .
<ej:Column Field="OrderDate" HeaderText="Order Date" EditType="DateTimePicker" Format="{0: MM/dd/yyyy hh:mm:ss:ff tt}" TextAlign="Right" Width="80">
<DateTimeEditOptions TimeDisplayFormat="h:mm:ss:ff tt" />
</ej:Column>
<ej:Column Field="ShipCountry" HeaderText="Ship Country" Width="90"/>
</Columns>
</ej:Grid> |
Hello,
I don´t wanto to edit dates, I want to edit amounts of time with the format:
HOURS:MINUTES:SECONDS:MILLISECONDOS
That's why I use TimeSpan data instead of DateTime data. I don't need popups to edit dates, I need enter an amount of time, for example, 00:05:02:000 five minutes and two seconds.
Thanks.
<ej:Grid ID="OrdersGrid" ClientIDMode="Static" runat="server" AllowSorting="True" AllowPaging="True" AllowGrouping="true">
. . .
<Columns>
. . .
<ej:Column Field="OrderDate" HeaderText="Order Date" EditType="DateTimePicker" Format="{0: hh:mm:ss:ff tt}" TextAlign="Right" Width="80">
<EditTemplate Create="create" Read="read" Write="write" />
</ej:Column>
<ej:Column Field="ShipCountry" HeaderText="Ship Country" Width="90"/>
</Columns>
</ej:Grid>
<script type="text/javascript">
function create() {
return $("<input>");
}
function write(args) {
//Render the ejTimePicker
args.element.ejTimePicker({ width: "100%", timeFormat: "h:mm:ss:fff tt", value: args.rowdata["OrderDate"] });
}
function read(args) {
//return the picked value
return args.ejTimePicker("getValue");
}
</script> |
Hello,
Ok, that works! Two questions:
Thanks!
<ej:Grid ID="OrdersGrid" ClientIDMode="Static" runat="server" AllowSorting="True"AllowPaging="True" AllowGrouping="true">
. . .
<Columns>
. . .
<ej:Column Field="OrderDate" HeaderText="Order Date"EditType="DateTimePicker" Format="{0: hh:mm:ss:ff tt}" TextAlign="Right" Width="80">
<%--Remove this below highlighted code--%>
<EditTemplate Create="create" Read="read" Write="write" />
</ej:Column>
<ej:Column Field="ShipCountry" HeaderText="Ship Country" Width="90"/>
</Columns>
</ej:Grid>
|
<ej:Grid ID="OrdersGrid" ClientIDMode="Static" runat="server" AllowSorting="True" AllowPaging="True" AllowGrouping="true" ShowSummary="true">
. . .
<SummaryRows>
<ej:SummaryRow Title="TotalTime">
<SummaryColumn>
<ej:SummaryColumn CustomSummaryValue="calculateTotalTime" SummaryType="Custom" DataMember="OrderDate" DisplayColumn="OrderDate"/>
</SummaryColumn>
</ej:SummaryRow>
</SummaryRows>
</ej:Grid>
</div>
<script type="text/javascript">
function calculateTotalTime(summaryCol, summaryValue) {
//Summarize all the date with time in the Grid's dataSource
var sum = ej.sum(summaryValue, "OrderDate");
var d = new Date(sum);
return ej.format(d, "hh:mm:ss:ff tt", "en-US");
}
</script>
|
Hello,
I wanto to use EditTemplante, but I want to hide TimerPicker popup button. How to do that?
Thanks!
<script type="text/javascript">
function write(args) {
//Render the ejTimePicker
args.element.ejTimePicker({ width: "100%", timeFormat: "h:mm:ss:fff tt", showPopupButton:false, value: args.rowdata["OrderDate"] });
}
</script> |