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
835
how to add a custom column to my igGrid
posted

Hello,

I can bind my json data to my igGrid, and all is good.

What if I want to add a small icon or a little "Click for details" link on each row. I'm searching the API docs for clues.

Here's what I have that is indeed working, but I'd like to add some columns.

thanks.

Bob

function DisplayAccountsGrid(jsonData, member) {        
        var accountsJson = [];
        for (var i = 0; i < jsonData.length ; i++) {  // TESTING..
            accountsJson.push({"account": jsonData[i] });             
         };
        $("#accountsGrid").igGrid({
            autoGenerateColumns: false,
            width: null,           // will stretch to fit data
            caption: "Accounts for: " + member,
            dataSource: accountsJson,
            columns: [
                { headerText: "Account", key:"account", dataType: "string", width: "150px" },         
            ],
            primaryKey: "account",
            features: [
                {
                    name: "Sorting", type: "local"
                },
                {
                    name: "Tooltips",
                    columnSettings: [{ columnKey: "account", allowTooltips: true }],
                    visibility: "always",
                },
            ],
            cellClick: function (evt, ui) { GetAccountDetails(evt, ui); }
        });
      
    }