igGrid - responsive hide/template

by georgianastasov

HTML

<script src="https://igniteui.com/js/modernizr.min.js"></script>
<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
<script src="https://cdn-na.infragistics.com/igniteui/latest/js/infragistics.core.js"></script>
<script src="https://cdn-na.infragistics.com/igniteui/latest/js/infragistics.lob.js"></script>
<script src="https://igniteui.com/js-data/nw-customers-with-orders"></script>
<link href="https://cdn-na.infragistics.com/igniteui/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet"></link>
<link href="https://cdn-na.infragistics.com/igniteui/latest/css/structure/infragistics.css" rel="stylesheet"></link>

<table id="grid"></table>

CSS

body {
    padding: 0px !important;
    margin: 0px !important;
}

JavaScript

$(function () {
            $("#grid").igGrid({
                columns: [
                    { headerText: "Company Name", key: "CompanyName", dataType: "string", width: "20%" },
                    { headerText: "Contact Name", key: "ContactName", dataType: "string", width: "15%" },
                    { headerText: "Contact Title", key: "ContactTitle", dataType: "string", width: "20%" },
                    { headerText: "Address", key: "Address", dataType: "string", width: "20%" },
                    { headerText: "City", key: "City", dataType: "string", width: "10%" },
                    { headerText: "Country", key: "Country", dataType: "string", width: "15%" }
                ],
                autoGenerateColumns: false,
                autofitLastColumn: false,
                dataSource: nwCustomersWithOrders,
                width: "100%",
                features: [
                    {
                        //enable responsive feature
                        name: "Responsive",
                        enableVerticalRendering: false,
                        //set which column should be hidden or have template
                        columnSettings: [
                        		{
                                columnKey: "CompanyName",
                                configuration: {
                                    customPhone: {
                                        hidden: true
                                    },
                                    customAlt: {
                                        hidden: false
                                    }
                                }
                            },
                            {
                                columnKey: "ContactName",
                                configuration: {
                                    customPhone: {
                                        template: "${ContactName}, ${ContactTitle}, ${CompanyName}"
                                   ...