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
430
How to change headertext from columns iggrid with JavaScript
posted

Hi all, 

i need to change headertext from iggrid columns because i need to change language.

how i can make it with javascript?

thanks for advance

Parents
  • 19693
    Verified Answer
    posted

    Hello Ruben,

    Thank you for posting in our forums.

    You can refer to the following forum post discussing the same issue:

    https://es.infragistics.com/community/forums/f/ignite-ui-for-javascript/86461/how-to-change-headertext/431334#431334

    You may also use the headerCellRendered event handler for the purpose.

    https://www.igniteui.com/help/api/2013.2/ui.iggrid#events

    For example:

    $("#grid1").live("iggridheadercellrendered", function (event, ui) {

                var headerText, grid = ui.owner,

                     key = ui.columnKey,

                     th = ui.th;

                switch (key) {

                    case "EmployeeID":

                        headerText = '<%=this.GetGlobalResourceObject("Grid", "Northwind_Employees_EmployeeID").ToString() %>';

                        $(th[0]).text(headerText);

                        break;

                    case "Title":

                        headerText = '<%=this.GetGlobalResourceObject("Grid", "Northwind_Employees_Title").ToString() %>';

                        $(th[0]).text(headerText);

                        break;

                    case "Gender":

                        headerText = '<%=this.GetGlobalResourceObject("Grid", "Northwind_Employees_Gender").ToString() %>';

                        $(th[0]).text(headerText);

                        break;

                    case "HireDate":

                        headerText = '<%=this.GetGlobalResourceObject("Grid", "Northwind_Employees_HireDate").ToString() %>';

                        $(th[0]).text(headerText);

                        break;

                    case "SalariedFlag":

                        headerText = '<%=this.GetGlobalResourceObject("HierarchicalGrid", "SalariedFlag").ToString() %>';

                        $(th[0]).text(headerText);

                        break;

                }

            });

    Let me know if you need further assistance.

Reply Children
No Data