Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1710
Show Header
posted

I am trying to turn the header on and off in a grid, depending on if it has records or not.

It appears if I set showHeader to false when I create the grid I can never set that to true and have it display.

However if I set it to true when creating the grid and then call _setOption('showHeader', false);  It will hide but since this is a private method I was wondering the correct way to accomplish this.

Parents
  • 8736
    Verified Answer
    posted

    Hello,

    Thank you for the details provided. You can use below line to set header visibility to false using public API:

    $("#grid1").igGrid("option", "showHeader", false);

    Refer to the “OPTIONS” tab and look for showHeader on the link below:

    http://help.infragistics.com/jQuery/2012.2/ui.iggrid 

    If showHeader is false while initializing grid than the Header table is not created at all. I have also logged this behavior with development 135743. I will update this forum thread once this issue is resolved or if I have heard anything from development.

    Meanwhile, I would recommend you to set showHeader to false in the igloader function and show header when you need it as shown below:

    $("#grid1").igGrid({

    autoGenerateColumns:true, primaryKey:"ProductID",

     columns: [ { headerText: "Product ID",key: "ProductID",dataType: "number"},

            { headerText: "Name",key: "Name", dataType: "string"},

             { headerText: "ID",key: "ID", dataType: "number" },  

           { headerText: "ProductDate", key: "ProductDate", dataType: "date" }, ],  

           dataSource:products,  

           });

              $("#grid1").igGrid("option", "showHeader", false);   

             $("#button1").click(function()  

               {

                   $("#grid1").igGrid("option", "showHeader", true);

                });

           });

    I hope this helps.

Reply Children