- Home
- Forum
- ASP.NET Web Forms
- Row Details Template
Row Details Template
Good day.
I have a doubt with a field that I am using in the ROW DETAILS TEMPLATE control since I am handling a date field and I want to modify its format different from the default one DDDD / MMM / YYYY HH: MM: SS .... to DD / MM / YYYY HH: MM.
I send my HTML Code and image describe them.
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Site.Master" CodeFile="ContainerInventory.aspx.cs" Inherits="ContainerInventory" %>
<%@ Register Assembly="Syncfusion.EJ.Web, Version=16.2460.0.41, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" Namespace="Syncfusion.JavaScript.Web" TagPrefix="ej" %>
<%@ Register Assembly="Syncfusion.EJ, Version=16.2460.0.41, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" Namespace="Syncfusion.JavaScript.Models" TagPrefix="ej" %>
<asp:Content ID="Cinventory" ContentPlaceHolderID="MainContent" runat="server">
<div>
<script type="text/template" id="colTip">
{{:value }}
</script>
<script id="tabGridContents" type="text/x-jsrender">
<div id="Contenedor{{:strContainerId }}" style="font-weight: bold; padding: 5px;">
<div id="cont">
Puerto de Origen: {{: strContainerInvPortOfOriginId }} <br />
Puerto de Descarga: {{: strContainerInvDischargePortId }} <br />
Estado Administrativo: {{: strContAdmStatusIdentifier }}<br />
Estado Fiscal: {{: strContFisStatusIdentifier }}<br />
Estado Fisico: {{: strContPhyStatDescription }}<br />
VGM: {{: decContainerInventoryVGM }}<br />
Ingreso: {{: strContTransTypeDescription }}<br />
Fecha Ingreso: {{: dtmContainerInvReceptionDate }}<br />
IMO: {{: blnHasIMO }} <br />
<!-- Format="{0:dd/MM/yyyy hh:mm:ss}" -->
</div>
</div>
</script>
</div>
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<ej:Grid ID="Grid1" runat="server" AllowPaging="true" OnServerExcelExporting="Grid1_ServerExcelExporting" DetailsTemplate="#tabGridContents"
AllowSorting="true" EnableToolbarItems="true" AllowResizing="true" AllowTextWrap="true" Locale="es-ES"
OnServerCommandButtonClick ="Grid1_ServerCommandButtonClick">
<TextWrapSettings WrapMode="Header" />
<PageSettings PageSize="50" />
<ToolbarSettings ShowToolbar="True" ToolbarItems="search,excelExport,printGrid" />
<Columns>
<ej:Column Field="intContainerUniversalId" HeaderText="Universal" IsPrimaryKey="true" />
<ej:Column Field="strContainerId" HeaderText="Contenedor" />
<ej:Column Field="strContainerSizeIdentifier" HeaderText="Tamaño" />
<ej:Column Field="strContainerTypeIdentifier" HeaderText="Tipo" />
<ej:Column Field="strContainerInvYardPositionId" HeaderText="Posicion" />
<ej:Column Field="blnContainerIsFull" HeaderText="Lleno/Vacio" />
<ej:Column Field="blnHasIMO" HeaderText="IMO" Visible="false" />
<ej:Column Field="strShippingLineIdentifier" HeaderText="Naviera" />
<ej:Column Field="strCompanyName" HeaderText="Cliente" Tooltip="#colTip" ClipMode="EllipsisWithTooltip" />
<ej:Column Field="dtmContainerInvReceptionDate" HeaderText="Fecha de Ingreso" Visible="false" />
<ej:Column Field="decContainerInventoryWeight" HeaderText="Peso" />
<ej:Column Field="strContainerInvPortOfOriginId" HeaderText="Puerto de Origen" Visible="false" />
<ej:Column Field="strContainerInvDischargePortId" HeaderText="Puerto de Descarga" Visible="false"/>
<ej:Column Field="strFiscalMovementIdentifier" HeaderText="Trafico" />
<ej:Column Field="strContAdmStatusIdentifier" HeaderText="Estado Administrativo" Visible="false" />
<ej:Column Field="strContFisStatusIdentifier" HeaderText="Estado Fiscal" Visible="false" />
<ej:Column Field="strContPhyStatDescription" HeaderText="Estado Fisico" Visible="false" />
<ej:Column Field="decContainerInventoryVGM" HeaderText="VGM" Visible="false" />
<ej:Column Field="strContTransTypeDescription" HeaderText="Tipo de Ingreso" Visible="false" ></ej:Column>
<%--<ej:Column HeaderText="Detalles" >
<Command>
<ej:Commands Type="detail">
<ButtonOptions Text="Details" Width="100"></ButtonOptions>
</ej:Commands>
</Command>
</ej:Column>--%>
<%--<ej:Column HeaderText="HyperLink" Template="<a rel='nofollow' href='ContainerInventoryDetail.aspx?id=<%# Eval("intContainerUniversalId") %>'>Detalles</a>" TextAlign="Center" />--%>
<%--<ej:Column HeaderText="HyperLink" Template="<a rel='nofollow' href='ContainerInventoryDetail.aspx?intContainerUniversalId={{:intContainerUniversalId}}'>Detalles</a>" TextAlign="Center" Visible="false"/>--%>
</Columns>
</ej:Grid>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="Grid1" />
</Triggers>
</asp:UpdatePanel>
</div>
</asp:Content>
<%@ Register Assembly="Syncfusion.EJ.Web, Version=16.2460.0.41, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" Namespace="Syncfusion.JavaScript.Web" TagPrefix="ej" %>
<%@ Register Assembly="Syncfusion.EJ, Version=16.2460.0.41, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" Namespace="Syncfusion.JavaScript.Models" TagPrefix="ej" %>
<asp:Content ID="Cinventory" ContentPlaceHolderID="MainContent" runat="server">
<div>
<script type="text/template" id="colTip">
{{:value }}
</script>
<script id="tabGridContents" type="text/x-jsrender">
<div id="Contenedor{{:strContainerId }}" style="font-weight: bold; padding: 5px;">
<div id="cont">
Puerto de Origen: {{: strContainerInvPortOfOriginId }} <br />
Puerto de Descarga: {{: strContainerInvDischargePortId }} <br />
Estado Administrativo: {{: strContAdmStatusIdentifier }}<br />
Estado Fiscal: {{: strContFisStatusIdentifier }}<br />
Estado Fisico: {{: strContPhyStatDescription }}<br />
VGM: {{: decContainerInventoryVGM }}<br />
Ingreso: {{: strContTransTypeDescription }}<br />
Fecha Ingreso: {{: dtmContainerInvReceptionDate }}<br />
IMO: {{: blnHasIMO }} <br />
<!-- Format="{0:dd/MM/yyyy hh:mm:ss}" -->
</div>
</div>
</script>
</div>
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<ej:Grid ID="Grid1" runat="server" AllowPaging="true" OnServerExcelExporting="Grid1_ServerExcelExporting" DetailsTemplate="#tabGridContents"
AllowSorting="true" EnableToolbarItems="true" AllowResizing="true" AllowTextWrap="true" Locale="es-ES"
OnServerCommandButtonClick ="Grid1_ServerCommandButtonClick">
<TextWrapSettings WrapMode="Header" />
<PageSettings PageSize="50" />
<ToolbarSettings ShowToolbar="True" ToolbarItems="search,excelExport,printGrid" />
<Columns>
<ej:Column Field="intContainerUniversalId" HeaderText="Universal" IsPrimaryKey="true" />
<ej:Column Field="strContainerId" HeaderText="Contenedor" />
<ej:Column Field="strContainerSizeIdentifier" HeaderText="Tamaño" />
<ej:Column Field="strContainerTypeIdentifier" HeaderText="Tipo" />
<ej:Column Field="strContainerInvYardPositionId" HeaderText="Posicion" />
<ej:Column Field="blnContainerIsFull" HeaderText="Lleno/Vacio" />
<ej:Column Field="blnHasIMO" HeaderText="IMO" Visible="false" />
<ej:Column Field="strShippingLineIdentifier" HeaderText="Naviera" />
<ej:Column Field="strCompanyName" HeaderText="Cliente" Tooltip="#colTip" ClipMode="EllipsisWithTooltip" />
<ej:Column Field="dtmContainerInvReceptionDate" HeaderText="Fecha de Ingreso" Visible="false" />
<ej:Column Field="decContainerInventoryWeight" HeaderText="Peso" />
<ej:Column Field="strContainerInvPortOfOriginId" HeaderText="Puerto de Origen" Visible="false" />
<ej:Column Field="strContainerInvDischargePortId" HeaderText="Puerto de Descarga" Visible="false"/>
<ej:Column Field="strFiscalMovementIdentifier" HeaderText="Trafico" />
<ej:Column Field="strContAdmStatusIdentifier" HeaderText="Estado Administrativo" Visible="false" />
<ej:Column Field="strContFisStatusIdentifier" HeaderText="Estado Fiscal" Visible="false" />
<ej:Column Field="strContPhyStatDescription" HeaderText="Estado Fisico" Visible="false" />
<ej:Column Field="decContainerInventoryVGM" HeaderText="VGM" Visible="false" />
<ej:Column Field="strContTransTypeDescription" HeaderText="Tipo de Ingreso" Visible="false" ></ej:Column>
<%--<ej:Column HeaderText="Detalles" >
<Command>
<ej:Commands Type="detail">
<ButtonOptions Text="Details" Width="100"></ButtonOptions>
</ej:Commands>
</Command>
</ej:Column>--%>
<%--<ej:Column HeaderText="HyperLink" Template="<a rel='nofollow' href='ContainerInventoryDetail.aspx?id=<%# Eval("intContainerUniversalId") %>'>Detalles</a>" TextAlign="Center" />--%>
<%--<ej:Column HeaderText="HyperLink" Template="<a rel='nofollow' href='ContainerInventoryDetail.aspx?intContainerUniversalId={{:intContainerUniversalId}}'>Detalles</a>" TextAlign="Center" Visible="false"/>--%>
</Columns>
</ej:Grid>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="Grid1" />
</Triggers>
</asp:UpdatePanel>
</div>
</asp:Content>
SIGN IN To post a reply.
3 Replies
VN
Vignesh Natarajan
Syncfusion Team
May 10, 2019 04:29 AM UTC
Hi Alfonso,
Thanks for contacting Syncfusion support.
Query: “I want to modify its format different from the default one DDDD / MMM / YYYY HH: MM: SS .... to DD / MM / YYYY HH: MM.”
From your query, we understand that you need to apply format to date object render using js render. We suggest you to achieve your requirement using helper functions support for JS render template. Refer the below code example
|
<script id="tabGridContents" type="text/x-jsrender">
<div id="contact{{:EmployeeID }}" style="font-weight: bold; padding: 5px;">
<div id="cont">
contact:{{:Address }}<br />
city:{{:City }}<br />
Country:{{:Country }}<br />
phone:{{:HomePhone }}<br />
BirthDate:{{:~format(BirthDate)}}<br />
</div>
</div>
</script>
<ej:Grid ID="DetailTemplate" runat="server" DetailsTemplate="#tabGridContents">
<Columns>
<ej:Column Field="EmployeeID" HeaderText="Employee ID" />
<ej:Column Field="FirstName" HeaderText="First Name" />
<ej:Column Field="Title" HeaderText="Title" />
<ej:Column Field="City" HeaderText="City" />
<ej:Column Field="Country" HeaderText="Country" />
</Columns>
</ej:Grid>
<script type="text/javascript">
function myFormatFunction(value) {
return value.toLocaleString();
}
var myHelpers = { format: myFormatFunction };
$.views.helpers(myHelpers);
</script> |
Refer the below screenshot for the output
|
|
Refer the below link for your reference
Please get back to us if you have further queries.
Regards,
Vignesh Natarajan.
AL
Alfonso
May 10, 2019 03:12 PM UTC
thank you very much for solving the doubt, I worked perfectly thanks for the support, greetings.
VN
Vignesh Natarajan
Syncfusion Team
May 13, 2019 04:00 AM UTC
Hi Alfonso,
Thanks for the update.
We are glad to hear that your query has been resolved by our solution.
Please get back to us if you have further queries.
Regards,
Vignesh Natarajan.
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
AL Alfonso
- May 9, 2019 03:47 PM UTC
- May 13, 2019 04:00 AM UTC