Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to achieve the effect in the picture #7886

Open
afr751116 opened this issue Apr 25, 2024 · 2 comments
Open

How to achieve the effect in the picture #7886

afr751116 opened this issue Apr 25, 2024 · 2 comments

Comments

@afr751116
Copy link

[] bug report => see 'Providing a Reproducible Scenario'
[] feature request => do not use Github for feature requests, see 'Customers of AG Grid'
[x] support request => see 'Requesting Community Support'

When you want to edit cells, another window pops up with A nested table, where the value of A is passed to table B, and table B finally returns the value to A

image

default.mp4

AG Grid version: 30.2.0
Browser: Google Chrome 123.0
Language: [ TypeScript 4.3.5 | ES5]

@nsnans
Copy link

nsnans commented May 7, 2024

说一下如果是我做的想法

1、使用cellRender渲染商品编码,这个组件有个params的props,可以获取到当前行和当前key还有node等

2、输入框聚焦事件,通过params.context?.componentParent?.xxx,调它父级也就是的方法打开弹窗

3、输入框里面绑定一个onChange事件,通过rxjs的Subject发布订阅把输入的值和当前的params弄成对象发送过去

4、在窗口组件里使用Subject的subscribe接受发送过来的值进行筛选之类的操作

5、点击扫码,窗口组件emit个事件,抛出窗口选中行和通过Subject接受到的params

6、关闭弹窗,通过params.node.setData就可以设置第一行数据了。第二行就先通过params.rowIndex获取第一行的下标,加1,然后获取所有node,找到这个rowIndex一样的更新上2就行了

就是弹窗显示在那个有点麻烦

@afr751116
Copy link
Author

如果是我做的想法的话

1、使用cellRender渲染商品编码,这个组件有一个params的props,可以获取到当前行和当前key还有node等

2、输入框聚焦事件,通过params.context?.componentParent?.xxx,调它父级的方法打开弹窗

3、输入框里面绑定一个onChange事件,通过rxjs的Subject发布订阅把输入的值和当前的params弄成对象发送过去

4、在窗口组件里使用Subject的subscribe接受发送过来的值进行筛选之类的操作

5、点击扫码,窗口组件emit个事件,触发窗口选中行并通过Subject接受到的参数

6、关闭弹窗,通过params.node.setData就可以设置第一行数据了。第二行就先通过params.rowIndex获取第一行的下标,加1,然后获取所有节点,找到这个rowIndex一样的更新上2就行了

就是窗弹显示有点麻烦

多谢提示,主思路也是根据这样完成了,不过确实麻烦,还有一些细节没处理好

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants