Skip to content

Need to show some message like popover when onRowMouseEnter or onRowMouseLeave fired! #7096

Closed
react-component/table
#171

Description

@jzoe

What problem does this feature solve?

I need to show user some information when onRowMouseEnter fired! This could be a message or record data.

需要在 onRowMouseEnter 事件触发时显示一个类似于 Popover 的消息框,这个消息框给出该行的数据或者其它信息。

What does the proposed API look like?

  const handleMouseEnter = (record, index) => {
    <Popover content={record.msg}/>
  }

Activity

  1. ant-design-bot commented on Aug 5, 2017

    @ant-design-bot
    Contributor

    It will be better to write your issue/comment in English, so more people can understand you.
    And this means that more people can help you or benefit from your issue/comment.
    See: #4897

  2. changed the title [-]增加 table 的 onRowMouseEnter 和 onRowMouseLeave 事件渲染组件的支持[/-] [+]Need to show some message like popover when onRowMouseEnter or onRowMouseLeave fired![/+] on Aug 5, 2017
  3. ddcat1115 commented on Aug 5, 2017

    @ddcat1115
    Contributor

    In fact, we have supported it...

    https://github.com/react-component/table#api search by onRowMouseEnter and onRowMouseLeave

  4. jzoe commented on Aug 6, 2017

    @jzoe
    Author

    I have been see those APIs in the new version, my question is about how to render the the message like Popover in onRowMouseEnter and onRowMouseLeave event handler !

  5. benjycui commented on Aug 7, 2017

    @benjycui
    Contributor

    my question is about how to render the the message like Popover in onRowMouseEnter and onRowMouseLeave event handler !

    So, the Popover is for the whole row or just one cell?

  6. jzoe commented on Aug 7, 2017

    @jzoe
    Author

    One cell Popover can write in column's render API, but i have never seen how to write a Popover for the whole row!

  7. benjycui commented on Aug 7, 2017

    @benjycui
    Contributor

    One cell Popover can write in column's render API, but i have never seen how to write a Popover for the whole row!

    Just write in columns's render API, and use visible to control it.

    columns[n].render = <Popover visible={visible} />
    
    onRowMounseEnter = () => visible = true;
  8. jzoe commented on Aug 7, 2017

    @jzoe
    Author

    @benjycui It's a good solution in some case. But if i have 10 columns or more, maybe the columns[n] is not present in current window, and in such case, we cannot see the Popover any more!

    If there is no other solution, maybe we could use the Table's expandedRowRender to show the full record information.

  9. benjycui commented on Aug 7, 2017

    @benjycui
    Contributor

    But if i have 10 columns or more, maybe the columns[n] is not present in current window, and in such case, we cannot see the Popover any more!

    Fixed column.

  10. jzoe commented on Aug 8, 2017

    @jzoe
    Author

    But i think the most elegant solution is that the table's onRowMounseEnter API support render() . So developer can use this API to show anything they want in a easy way! It's a pretty common, natural idea to show message through the onRowMounseEnter, isn't it?

  11. benjycui commented on Aug 8, 2017

    @benjycui
    Contributor

    But i think the most elegant solution is that the table's onRowMounseEnter API support render().

    It is not elegant at all. Event handle is not a renderer. Think in React.

    It's impossible to wrap table row with Popover now, unless Table expose new API cc @yesmeck

    So I think the only work around is #7096 (comment) now.

  12. jzoe commented on Aug 8, 2017

    @jzoe
    Author

    Look forward the new API, thanks for your awesome work!! @benjycui @yesmeck

  13. yesmeck commented on Aug 8, 2017

    @yesmeck
    Member

    I like this idea react-component/table#139, so that we don't need defined so many onRowXxxx events.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions