[CLOSED] Grid's DateColumn Format not working in IE8

  1. #1

    [CLOSED] Grid's DateColumn Format not working in IE8

    Hi Ext Team,

    Below is my test Code:

    //Model
     public class GridClass
        {
            public DateTime Month { get; set; }
            public double Price { get; set; }
            public string CountryName { get; set; }
            public string Currency { get; set; }
    
    
            public static List<GridClass> GetRecords()
            {
                List<GridClass> list = new List<GridClass>();
                list.Add(new GridClass() { CountryName = "Albania"  , Currency="EUR" , Month = Convert.ToDateTime("3/2014") , Price =1.1});
                list.Add(new GridClass() { CountryName = "Albania", Currency = "EUR", Month = Convert.ToDateTime("4/2014"), Price = 1.1 });
                list.Add(new GridClass() { CountryName = "Albania", Currency = "EUR", Month = Convert.ToDateTime("5/2014"), Price = 1.1 });
                list.Add(new GridClass() { CountryName = "Albania", Currency = "EUR", Month = Convert.ToDateTime("6/2014"), Price = 1.1 });
                list.Add(new GridClass() { CountryName = "Albania", Currency = "EUR", Month = Convert.ToDateTime("6/2014"), Price = 1.1 });
                list.Add(new GridClass() { CountryName = "Lativia", Currency = "EUR", Month = Convert.ToDateTime("3/2014"), Price = 1.1 });
                list.Add(new GridClass() { CountryName = "France", Currency = "EUR", Month = Convert.ToDateTime("3/2014"), Price = 1.1 });
                list.Add(new GridClass() { CountryName = "Belgium", Currency = "EUR", Month = Convert.ToDateTime("3/2014"),Price =1.1 });
                return list;
            }
    
        }
    //View
    @functions
    {
        private Store CreateStore(List<GridClass> list)
        {
            Store store = new Store();
            store.ID = "PriceTrendStoreTabView";
            var model = new Model();
    
            model.Fields.Add(new ModelField("Month"));
            model.Fields.Add(new ModelField("Price"));
            model.Fields.Add(new ModelField("CountryName"));
            model.Fields.Add(new ModelField("Currency"));
    
            store.Model.Add(model);
            store.DataSource = list;
    
            return store;
        }
    
        private void Initchart(Container pnlGrafico)
        {
            Ext.Net.GridPanel grid = new GridPanel()
            {
                ID = "gridPriceTrendTab",
                ForceFit = false,
                ColumnLines = true,
                EmptyText = "No data found",
            };
    
            var result = GridClass.GetRecords();
    
            var store = CreateStore(result);
            grid.Store.Add(store);
            
            grid.ColumnModel.Add(new DateColumn()
            {
                Text = "Month",
                DataIndex = "Month",
                ID = "colMonth",
                Format = "MMM-yy",
                StyleSpec = "font-weight:bold",            
    
            });
    
            grid.ColumnModel.Add(new Column()
            {
                Text = "Country",
                DataIndex = "CountryName",
                ID = "colCountryName",            
                StyleSpec = "font-weight:bold",            
            });
    
            grid.ColumnModel.Add(new Column()
            {
                Text = "Price Value",
                DataIndex = "Price",
                ID = "colPrice",
                StyleSpec = "font-weight:bold",
            });
    
            grid.ColumnModel.Add(new Column()
            {
                Text = "Currency",
                DataIndex = "Currency",
                ID = "colCurrency",
                StyleSpec = "font-weight:bold",
            });
            pnlGrafico.Items.Add(grid);
        }
    }
    
    @( Html.X().Container().ID("pnlPriceTrendTabular")
            //.ID("container_Trend")
                    .Height(400)
                     .DefaultAnchor("100%")
                    .Layout(LayoutType.Fit)
                    .AutoScroll(true)
                    .Control(item => this.Initchart(item))
    
             )
    //Controller
      public ActionResult Grid()
            {
                return View();
            }
    when i run this code i get empty grid as shown below:

    Click image for larger version. 

Name:	emptygrid.png 
Views:	19 
Size:	5.7 KB 
ID:	9371

    But when i exclude the column from the grid, i can see the rest of the columns.Please refer below screen shot:

    Click image for larger version. 

Name:	grid1.PNG 
Views:	32 
Size:	19.2 KB 
ID:	9381

    This is for Browser IE 8.

    Can u pls let me know what am i missing / wrong

    Thanks
    Last edited by Daniil; Apr 07, 2014 at 5:41 PM. Reason: [CLOSED]
  2. #2
    Try to set Type="Date" for Month model field
  3. #3
    Quote Originally Posted by Vladimir View Post
    Try to set Type="Date" for Month model field
    Thanks it worked

Similar Threads

  1. Replies: 2
    Last Post: Jan 28, 2014, 10:08 AM
  2. [CLOSED] Flushing data to form´s store
    By RCN in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: May 04, 2012, 10:13 PM
  3. [CLOSED] Using Form´s values when loading store
    By RCN in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Feb 28, 2012, 12:55 PM
  4. Replies: 1
    Last Post: Aug 31, 2010, 6:33 AM
  5. Editor.Add for grid column not working on 0.7?
    By _Belial in forum 1.x Help
    Replies: 9
    Last Post: Mar 25, 2009, 5:12 AM

Tags for this Thread

Posting Permissions