Code Monkey home page Code Monkey logo

Comments (9)

signalwerk avatar signalwerk commented on July 28, 2024 1

I think it would be good if we could do something like:

// Custom component for the Item rendered
class Item extends React.Component {
  render(){
    return <div styles="width: {this.props.width}">{this.props.item.title}</div>;
  }
};

// Timeline using a custom Item-Renderer
class Root extends React.Component {
  render(){
    return (
      <Timeline groups={groups}
                items={items}
                itemRenderer={<Item/>}
                />
    );
  }
}

That would help to make the Items as flexible as possible. @gyarasu and @tacticalcoding could solve their problem with it. right?

from react-calendar-timeline.

dmr avatar dmr commented on July 28, 2024 1

That would be great!

from react-calendar-timeline.

gyarasu avatar gyarasu commented on July 28, 2024 1

@signalwerk
I see.
Sorry for my misunderstanding.
I'm looking forward to implementing this solution!

from react-calendar-timeline.

mariusandra avatar mariusandra commented on July 28, 2024 1

Hey, we already have itemRenderer since v0.13.0 and it is possible to give any React prop as the title of the group, as shown in the treeGroups demo (source).

So I'm closing this thread! 🎉

from react-calendar-timeline.

dmr avatar dmr commented on July 28, 2024

I think this not easy to do because the items are scaled depending on the width. But I agree it would be a cool feature. Maybe a customizable "tooltip" as a first step

from react-calendar-timeline.

gyarasu avatar gyarasu commented on July 28, 2024

Is it easy to put a link(<a>) to group cell?

For example, Adding 'href' property to object in groups array.

const groups = [
      {id: 1, title: 'group 1', href: 'http://example.com'}, // this group will be rendered as a link
      {id: 2, title: 'group 2'}
    ];

from react-calendar-timeline.

gyarasu avatar gyarasu commented on July 28, 2024

@signalwerk
Thank you very much for your response!

Unfortunately, it doesn't work.
'Item' component has never been rendered, as long as I try.

I want to know more about 'itemRenderer' property.
However, I can't find the information about that property(itemRenderer).
How do you know about 'itemRenderer'?

from react-calendar-timeline.

signalwerk avatar signalwerk commented on July 28, 2024

I'm sorry @gyarasu if I puzzled you. @dmr and me were suggesting how to handle that case. But it's not implemented yet. Sorry for any inconvenience.

from react-calendar-timeline.

dmr avatar dmr commented on July 28, 2024

Very cool, thank you!

from react-calendar-timeline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.