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

Polymer binding events array attribute #7

Closed
threeaccents opened this issue Jul 17, 2017 · 5 comments
Closed

Polymer binding events array attribute #7

threeaccents opened this issue Jul 17, 2017 · 5 comments

Comments

@threeaccents
Copy link
Contributor

threeaccents commented Jul 17, 2017

I am trying to data bind events received from an api call to the events attribute. Here is an example for brevity I've removed the the ajax call.

<link rel="import" href="../bower_components/polymer/polymer-element.html">
<link rel="import" href="../bower_components/scheduler-component/scheduler-component.html">

<dom-module id="my-view1">
  <template>
    <scheduler-component 
      default-view="month" 
      editable 
      show-categories 
      all-day-text="All Day" 
      event-color="#378006"
      text-color="#ecf0f1" 
      hidden-days='[0]' 
      max-time="18:00:00" 
      min-time="07:00:00" 
      day-names='["Sunday", "Monday", "Tuesday", "Wednesday","Thursday", "Friday", "Saturday"]'
      events="[[events]]"
      header='{"right":"today","left":"prev,next","center":"month,agendaWeek,agendaDay"}'>
    </scheduler-component>
    [[events]]
    <iron-request id="xhr"></iron-request>
  </template>

  <script>
    class MyView1 extends Polymer.Element {
      static get is() { return 'my-view1'; }

      static get properties() {
        return {
          events: Array
        }
      }

      ready() {
        super.ready();
        this.events = [
          { "title": "event1", "start": "2017-07-06", "category": "Holiday" },
          { "title": "event2", "start": "2017-07-12", "end": "2017-07-14" },
          { "title": "event3", "start": "2017-07-15T12:30:00", "allDay": false },
          { "title": "event4", "start": "2017-07-17T10:30:00", "durationEditable": false }
        ];
      }
    }

    window.customElements.define(MyView1.is, MyView1);
  </script>
</dom-module>

So the issue I am having is that no event is being rendered to the screen. As you can see I'm "printing" the events property under the calendar component and it is displaying the object array correctly there. If I add the same array directly on the attribute the events are displayed properly.

@threeaccents threeaccents changed the title binding events array Polymer binding events array attribute Jul 17, 2017
@threeaccents
Copy link
Contributor Author

I've opened up a pull request to allow for data binded events. #8

@HaithemMosbahi
Copy link
Owner

Hello,
First of all Thank you for your collaboration and for raising this issue.
Yes, I agree with you, this is an issue. As i'm sure you have noticed that the development of this component is still in its early days, so I haven't added yet observers methods in order to watch attributes changes.
I'm gonna check out your pull request and I will get back to you.

@threeaccents
Copy link
Contributor Author

threeaccents commented Jul 17, 2017

Sorry about the close and reopen I closed it by accident.
Do you have a todo list of maybe feature additions you are working on? Reason I ask is because I'm currently converting an Aurelia app we have into a Polymer app. The previous Aurelia app used full calendar api extensively.
I think I can be a good "dog fooder" for this component early days. If there is a todo list I can check if feature addition is there already instead of opening an issue.
Also if you guys need some dev help I'm more than willing to give a hand.

@HaithemMosbahi
Copy link
Owner

HaithemMosbahi commented Jul 17, 2017

That sounds great to me.
You are very welcome to contribute and to participate in the development of this component. I believe your additions will be valuable and helpful for us as you are working on a use case that uses full calendar api extensively.
For the todo list, I've added some features in the issues section. For now I have two features in mind

Actually, I've worked on a similar component that uses polymer 1.0. I wanted to start a new version with polymer 2.0
I will open an issue to fix a todo list and to organize the priorities of the next version. I will have it done by tomorrow.
As I said, you are very welcome to contribute even to our todo list.

@HaithemMosbahi
Copy link
Owner

resolved #8

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

No branches or pull requests

2 participants