igGrid - bool

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/external/jsrender.js"></script>
<script src="https://igniteui.com/data-files/adventureworks.min.js"></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>

JavaScript

$(function () {
            $("#grid").igGrid({
                autoGenerateColumns: false,
                renderCheckboxes: true,
                width: "100%",
                height: "600px",
                templatingEngine: "jsrender",
                columns: [
                  { headerText: "Product ID", key: "ProductID", dataType: "number", width: "15%" },
                    { headerText: "Product Name", key: "Name", dataType: "string", width: "40%" },
                    { headerText: "Product Number", key: "ProductNumber", dataType: "string", width: "15%" },
                     { headerText: "Finished Goods", key: "FinishedGoodsFlag", dataType: "bool", width: "15%"},  
                    { headerText: "Make Flag", key: "MakeFlag", dataType: "bool", width: "15%" }
                ],
                dataSource: adventureWorks,
                rowsRendered: function(evt, ui) {
                		// Key of the column that would be check for emptiness
            				let lookupColKey = "Name";
            				// Key of the column that would be changed
            				let targetColKey = "MakeFlag";
                    
                    // Using the columnIndex, one may get the index of the column with id #grid_colName
            				let lookupColIdx = $(`#grid_${lookupColKey}`).data("columnIndex");
                    console.log('look up col index');
                    console.log(lookupColIdx);
            				let targetColIdx = $(`#grid_${targetColKey}`).data("columnIndex");
                    console.log('target up col index');
                    console.log(targetColIdx);
                    $("#grid").igGrid("allRows").each((i) => {
                		let targetLookupCell = $("#grid").igGrid("cellAt", lookupColIdx, i + 1);
                    console.log('target cell');
                    console.log(targetLookupCell);
									
                		
            			});
                }
            });
        });