Slickgrid 需要合并光滑网格中的行。在slick grid的网格ui中需要rowTemplate()功能的替代品。
我们在网格ui中有rowtemplate(),我们可以在slick网格中有同样的功能 我必须合并备用行并在该合并行中显示数据 在网格ui中使用rowTemplate,我需要在slick grid中替代此功能Slickgrid 需要合并光滑网格中的行。在slick grid的网格ui中需要rowTemplate()功能的替代品。,slickgrid,angularjs-1.5,Slickgrid,Angularjs 1.5,我们在网格ui中有rowtemplate(),我们可以在slick网格中有同样的功能 我必须合并备用行并在该合并行中显示数据 在网格ui中使用rowTemplate,我需要在slick grid中替代此功能 // you could of course just include the template inline in your code, this example shows a template being returned from a function this.rowTemplat
// you could of course just include the template inline in your code, this example shows a template being returned from a function
this.rowTemplate = function() {
return '<div>' +
' <div ng-if="row.entity.merge">{{row.entity.title}}</div>' +
' <div ng-if="!row.entity.merge" ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.colDef.name" class="ui-grid-cell" ng-class="{ \'ui-grid-row-header-cell\': col.isRowHeader }" ui-grid-cell></div>' +
'</div>';
}
//当然,您可以在代码中内联包含模板,此示例显示从函数返回的模板
this.rowTemplate=函数(){
返回“”+
“{row.entity.title}”+
' ' +
'';
}
不认为有任何方法可以渲染整行,但column.formatter属性可用于控制单元格渲染
下面是一个极端的例子:
感谢@Ben为您提供的解决方案。我尝试过这种方法,但不符合我们的要求。嗯,我认为使用SlickGrid是不可能的。没有对行的控制,行只是包含单元格的元素的集合。可以通过控制单元渲染来渲染备用行,但这是唯一可能的方法。当然,您始终可以修改核心渲染代码以使用行模板。没那么难。谢谢@Ben的解决方案。