[CLOSED] gridpanel date localization problem (razor)

  1. #1

    [CLOSED] gridpanel date localization problem (razor)

    Hi there,

    I'm having the problem that a date in a gridpanel (which is in a popup window) isn't showed
    in the right format (de-DE). I tried to set the locale in the resourcemanager like that
    @Html.X().ResourceManager().Theme(Theme.Gray).ScriptMode(Ext.Net.ScriptMode.Debug).Locale("de")
    but the date is showed in english.
    What's the way to ensure the correct culture ???
    Perhaps in the web.config ? But what exactly ?
    I also tried
    new ModelField("EX_DATE", ModelFieldType.Date, "M/d hh:mmtt")
    The result is, that the date isn't displayed in the column of the gridpanel.

    I don't get it .......
    Any help ?


    Regards,
    Holger


        .Items(witems => {
            witems.Add(
                Html.X().GridPanel()
                    .ID("gridPanel_EX_Exportlauf")
                    .Width(550)
                    .Height(470)
                    .ForceFit(true)
                    .SelectionModel(sm =>
                    {
                        sm.Add(
                        Html.X().RowSelectionModel()
                        .SelectedRows(sr => { sr.Add(Html.X().SelectedRow().RowIndex(0)); }
    
                        )
                        );
                    })                
                    .Store(
                        Html.X().Store()
                        .PageSize(100)
                        .Buffered(true)
                        .Model(
                            Html.X().Model()
                            .Fields(
                                new ModelField("EX_RD", ModelFieldType.Int),
                                new ModelField("EX_ID", ModelFieldType.Int),
                                new ModelField("EX_DATE", ModelFieldType.Date)
                            )
                         )
                    .DataSource(Model)
                    )
                    .ColumnModel(
                        Html.X().Column().Text("RDBereich").DataIndex("EX_RD"),
                        Html.X().Column().Text("Exportlauf ID").DataIndex("EX_ID"),
                        Html.X().Column().Text("Datum Export").DataIndex("EX_DATE"),
                        Html.X().Column().Text("RDB").DataIndex("ES_RD_BEREICH")
                        
                    )
                    .DirectEvents(de =>
                    {
                        de.ItemDblClick.Url = Url.Action("DirectEventExportlaufClicked");
                        de.ItemDblClick.EventMask.ShowMask = true;
    
                        de.ItemDblClick.ExtraParams.Add(new Parameter("EX_ID", "record.get('EX_ID')", ParameterMode.Raw));                  
                    })
                );
    Last edited by Daniil; Mar 25, 2013 at 3:32 PM. Reason: [CLOSED]
  2. #2
    Hi Holger,

    Do you use a common column to show the dates? Well, it, generally, doesn't know anything what it shows, dates or somethings else. So, it doesn't localize dates.

    But a special DateColumn for dates should localize.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi Holger,

    Do you use a common column to show the dates? Well, it, generally, doesn't know anything what it shows, dates or somethings else. So, it doesn't localize dates.

    But a special DateColumn for dates should localize.
    I use it exactly as in the example above.
    So, what can I do to get german dates in the column ?

    I now tried this
    new ModelField("EX_DATE", ModelFieldType.Date, "d.m.Y H:i:s")
    with the result, that the date column is empty ....

    Regards,
    Holger
    Last edited by zwf; Mar 25, 2013 at 3:17 PM.
  4. #4
    Quote Originally Posted by zwf View Post
    I use it exactly as in the example above.
    So, what can I do to get german dates in the column ?

    I now tried this
    new ModelField("EX_DATE", ModelFieldType.Date, "d.m.Y H:i:s")
    with the result, that the date column is empty ....

    Regards,
    Holger
    I'm a fool.

    found the solution

                    .ColumnModel(
                        Html.X().Column().Text("RDBereich").DataIndex("EX_RD").Width(20),
                        Html.X().Column().Text("Exportlauf ID").DataIndex("EX_ID").Width(20),
                        Html.X().DateColumn().Text("Datum Export").DataIndex("EX_DATE").Format("d.m.Y H:i:s"),
                        Html.X().Column().Text("RDB").DataIndex("ES_RD_BEREICH")
                        
                    )
    has to be done in the ColumnModel with DateColumn and Format ......

    You can close this.

    Regards,
    Holger

Similar Threads

  1. [CLOSED] GridPanel CommandColumn localization
    By digitek in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 13, 2012, 4:03 PM
  2. Replies: 1
    Last Post: Apr 13, 2012, 1:52 PM
  3. [CLOSED] Calendar Panel Localization problem in codebehind
    By jcanton in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Oct 05, 2011, 4:00 PM
  4. Replies: 0
    Last Post: Jul 07, 2009, 4:34 AM
  5. [CLOSED] Problem when update date field in GridPanel
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Oct 04, 2008, 8:53 AM

Tags for this Thread

Posting Permissions