Grid panel header was not displaying

Page 2 of 2 FirstFirst 12
  1. #11
    RCN, i have posted it fully on #5 only thing i missed out is the json result function, by default on page load i dont see header for that gridpanel.

    var BindDestination= function (EMP_CODE) {
    
            $.ajax({
                url: '@Url.Action("Bind_Destination", "Setup")',
                   type: 'post',
                   data: { EMP_CODE: EMP_CODE },
                   success: function (data) {
                       var grid = Ext.getCmp("GPDesignation");
                       grid.getStore().loadData(data);
                   }
               });
           };
  2. #12
    Grid works as expected:

    Click image for larger version. 

Name:	gp002.png 
Views:	4 
Size:	14.5 KB 
ID:	21031

        @(Html.X().GridPanel()
            .ID("GPDesignation")
            .Width(1158)
            .Height(260)
            .Header(true)
            .Store(Html.X().Store()
            .PageSize(10)
            .ID("SDesignation")
            .Proxy(Html.X().AjaxProxy().Url(Url.Action("Bind_Destination")).Reader(Html.X().JsonReader().RootProperty("data")))
            .Model
            (Html.X().Model()
            .Fields(new ModelField("ROLE_CODE", ModelFieldType.String),
            new ModelField("ROLE_DESC", ModelFieldType.String),
            new ModelField("DESIGNATION_CODE", ModelFieldType.String),
            new ModelField("DESIGNATION_DESC", ModelFieldType.String),
            new ModelField("DEFAULT_DESIG", ModelFieldType.String))))
            .ColumnModel(Html.X().Column().Text("Role").DataIndex("ROLE_CODE").Width(150),
            Html.X().Column().Text("Role Description").DataIndex("ROLE_DESC").Width(326),
            Html.X().Column().Text("Designation").DataIndex("DESIGNATION_CODE").Width(250),
            Html.X().Column().Text("DSG Description").DataIndex("DESIGNATION_DESC").Width(326),
            Html.X().Column().Text("Default").DataIndex("DEFAULT_DESIG").Width(100))
            .SelectionModel(Html.X().RowSelectionModel())
        )
    namespace SandBox.Controllers
    {
        public class ExampleController : Controller
        {
            public ActionResult Index()
            {
                return View();
            }
    
            public StoreResult Bind_Destination()
            {
                List<Designation_Model> lst = new List<Designation_Model>();
    
                for (int index = 0; index < 15; index++)
                {
                    lst.Add(new Designation_Model
                    {
                        ROLE_CODE = index.ToString(),
                        ROLE_DESC = string.Format("ROLE_DESC - {0}", index),
                        DESIGNATION_CODE = string.Format("DESIGNATION_CODE - {0}", index),
                        DESIGNATION_DESC = string.Format("DESIGNATION_CODE - {0}", index),
                        DEFAULT_DESIG = string.Format("DEFAULT_DESIG - {0}", index)
                    });
                }
    
                return new StoreResult(lst, lst.Count());
            }
        }
    
        public class Designation_Model
        {
            public string ROLE_CODE { get; set; }
            public string ROLE_DESC { get; set; }
            public string DESIGNATION_CODE { get; set; }
            public string DESIGNATION_DESC { get; set; }
            public string DEFAULT_DESIG { get; set; }
        }
    }
    Last edited by RCN; Feb 11, 2015 at 3:30 PM.
  3. #13
    Sundarsureshin, there are other controls in your view that may be affecting GridPanel.

    Click image for larger version. 

Name:	gp003.png 
Views:	4 
Size:	12.2 KB 
ID:	21041

    In addition, please provide a running example. In the example provided by you, some classes are missing, it connects to database, etc.

    By @Geoffrey.Mcgill:
    If we cannot copy+paste your code sample directly into a test project, and run without having to fix unnecessary exceptions, your chances of receiving timely support are diminished.
    Last edited by RCN; Feb 12, 2015 at 12:14 PM.
  4. #14
    Thank you RCN, i will check on this.
  5. #15
    Please keep us posted.
  6. #16
    Sure, will do.
Page 2 of 2 FirstFirst 12

Similar Threads

  1. [CLOSED] Grid Panel not displaying data on button click
    By otouri in forum 2.x Premium Help
    Replies: 3
    Last Post: Apr 05, 2013, 6:30 PM
  2. Replies: 3
    Last Post: Apr 04, 2013, 9:54 AM
  3. [CLOSED] Displaying grid panel below text field input
    By MTSI in forum 2.x Premium Help
    Replies: 1
    Last Post: Mar 11, 2013, 12:31 PM
  4. Replies: 0
    Last Post: May 01, 2012, 9:43 AM
  5. Replies: 16
    Last Post: Feb 23, 2011, 10:03 AM

Tags for this Thread

Posting Permissions