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
205
Column templates with auto generated columns
posted

I am using igGrid with a JSON datasource that can contain different sets of columns which results in me using auto generated columns. I wish to apply column templates to these columns and want to know if this is possible. I can build a column template on the server where I know which columns will be used to populate the grid and pass it over to the client, but how do I apply that template to the grid when binding the data?

I am also interested in other customizations such as changing the Display Name, Column Width, Column Order etc of each column, can this be set through the column template?

Data binding on client:

$("#dataGrid").igGrid({
        autoGenerateColumns: true,
        defaultColumnWidth: "150px",
        width: "100%",
        dataSource: data,
        dataSourceType : "json",
        responseDataKey: "data"});