将动态参数传递给父部件中的单元渲染器(Ag网格)
如何基于单元格参数传递动态参数? 像这里一样,当我们基于单元格参数添加类时,
cellClassRules: {
'error-border': (params: any) => {
return params.error;
},
},
我想使用CellRendererParams进行相同的操作,但它不起作用:
cellRendererParams: {
someProp: (params: any) => {
return ...;
},
},
How to pass dynamic params based on cell params?
Like here when we adding class based on cell params
cellClassRules: {
'error-border': (params: any) => {
return params.error;
},
},
I want to do the same with cellRendererParams but it not working:
cellRendererParams: {
someProp: (params: any) => {
return ...;
},
},
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
说我有一个自定义的单元格渲染器。它具有我要设置的属性称为myprop的属性:
在我要使用的组件中,我必须将其添加到组件列表中:
然后,当我设置列时,我可以指定单元格渲染器并设置MyProp属性,例如这:
您的自定义组件肯定是使用的吗?设置自定义属性时,可以放置台。
让我知道你的状况
Say I have a custom cell renderer. It has a property called myProp that I want to set:
In the component I want to use it I have to add it to the list of components:
Then when I set up my columns I can specify the cell renderer and set the myProp property like this:
Is your custom component definitely being used? Can you put a console.log when you are setting your custom property?
Let me know how you get on