根据其他节点或行值的条件动态更改AG网格先前的cellStyle

时间:2018-10-14 03:24:34

标签: angular5 ag-grid ag-grid-ng2

我可以根据当前节点的某些条件来更改当前cellStyle。但是我必须根据当前节点中的某些情况来更改前一个cellStyle。

columnDefs = [
               { headerName: "TripStatus", field: "TripStatusCode",cellStyle: this.cellStyling},    
             ]

调用以下方法动态更改样式

cellStyling(params:any){  
       // This will change the current cell style only. But I need to change the style of immediate previous cell style. 
       if(params.node.TripStatusCode==='CO')   
       return {'background-color': 'red'};
  }

1 个答案:

答案 0 :(得分:0)

签出cellClassRules

import os
import sys

sys.path.append ('opy')
import opy

from setuptools import setup
import codecs

def read (*paths):
    with codecs.open (os.path.join (*paths), 'r', encoding = 'utf-8') as aFile:
        return aFile.read()

setup (
    name = 'Opy',
    version = opy.programVersion,
    description = 'OPY - Obfuscator for Python, string obfuscation added, keyword added',
    long_description = (
        read ('README.rst') + '\n\n' +
        read ('license_reference.txt')
    ),
    keywords = ['opy', 'obfuscator', 'obfuscation', 'obfuscate', 'kivy', 'pyo', 'python'],
    url = 'https://github.com/JdeH/Opy/',
    license = 'Apache 2',
    author = 'Jacques de Hooge',
    author_email = 'jacques.de.hooge@qquick.org',
    packages = ['opy'], 
    include_package_data = True,
    install_requires = [],
    classifiers = [
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Developers',
        'Natural Language :: English',
        'License :: Other/Proprietary License',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Operating System :: OS Independent',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
    ],
)

您可以根据需要定义任意多个类规则,只需用逗号分隔即可,该函数应返回true / false。