/*!@license * Infragistics.Web.ClientUI igGrid KnockoutJS extension 19.1.20 * * Copyright (c) 2011-2019 Infragistics Inc. * * http://www.infragistics.com/ * * Depends on: * jquery-1.9.1.js * ig.util.js * ig.dataSource.js * ig.ui.grid.framework.js */ (function(factory){if(typeof define==="function"&&define.amd){define(["../modules/infragistics.ui.grid.framework","knockout"],factory)}else{factory(jQuery,ko)}})(function($,ko){ko.bindingHandlers.igGrid={init:function(element,valueAccessor){var grid=$(element),gridObj=grid.data("igGrid"),binding,options,key;if(grid.attr("data-create")!=="false"){binding=ko.utils.unwrapObservable(valueAccessor());options={};options.dataSource=new $.ig.KnockoutDataSource({dataSource:binding.dataSource});for(key in binding){if(binding.hasOwnProperty(key)&&key!=="dataSource"){options[key]=binding[key]}}}else{binding=options=gridObj.options}grid.igGridKnockoutBridge();if(grid.attr("data-create")!=="false"){grid.igGrid(options)}else{grid.igGridKnockoutBridge("rebindCells")}return{controlsDescendantBindings:true}},update:function(element,valueAccessor){$(element).igGridKnockoutBridge("recordsUpdated",valueAccessor)}};ko.visitPropertiesOrArrayEntries=function(rootObject,visitorCallback){var i,propertyName;if(rootObject instanceof Array){for(i=0;itr[data-id='"+trId+"']").children("td[data-parent!=true][data-parent!=false][data-skip!=true]");l=0;fl=0;for(k=0;k0){tmpldata=origRec||{};if(!tmpldata.hasOwnProperty(key)){tmpldata[key]=viewModel}newFormattedVal=grid._renderTemplatedCell(tmpldata,valueAccessor.value);if(newFormattedVal&&newFormattedVal.startsWith("0){cell.prepend(editor)}grid.dataSource._ownUpdate=false},_bridgeGrid:function(grid){var handler=this._rebindCellsHandler;grid.bind({iggridrendering:this._gridRenderingHandler,iggridrendered:this._gridRenderedHandler,iggriddatarendered:handler,iggridvirtualrecordsrender:handler,iggridcolumnscollectionmodified:handler,iggridcolumnfixingcolumnfixed:handler})},_createHandlers:function(){this._rebindCellsHandler=$.proxy(this._rebindCells,this);this._gridRenderingHandler=$.proxy(this._gridRendering,this);this._gridRenderedHandler=$.proxy(this._gridRendered,this)}})});