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

strange behavior #155

Closed
paridin opened this issue May 2, 2016 · 3 comments
Closed

strange behavior #155

paridin opened this issue May 2, 2016 · 3 comments

Comments

@paridin
Copy link

paridin commented May 2, 2016

I try to implement this add-on in my code,

So update my Api to return the same meta, so the behavior I got is automatically the add-on, send the request until the pages is full, so it renders all the request before execute the scroll,

To clarify my issue I can't implement the scroll, here is my code.

import Ember from 'ember';
import InfinityRoute from "ember-infinity/mixins/route";
// route/index.js
export default Ember.Route.extend(InfinityRoute, {
    model() {
        return this.infinityModel('trademark', {perPage: 20, startingPage: 1});
    }
});
  "meta": {
        "page": 3,
        "per_page": 20,
        "total_pages": 3,
        "total_records": 58
    }

and my template looks

<div class="row" id='list-trademarks'>
{{#each model as |trademark|}}
    <div class="col s12 m6 l4">
      <div class="card small" style='padding-top: 0 !important; margin-top: 0 !mportant'>

           {{card-limit-display relCards=trademark.marcanet title=trademark.title panref=trademark.id total=trademark.relatedTotal}}

        <div class="card-reveal">
          <span class="card-title grey-text text-darken-4">{{trademark.title}} similares.<i class="material-icons right">close</i></span>
          {{card-hidden hiddenCards=trademark.marcanet}}
        </div>
      </div>
    </div>
{{/each}}
{{infinity-loader infinityModel=model  destroyOnInfinity=true}}
</div>

I'm following the README but I can't get it works.
Ember info

DEBUG: Ember           : 2.4.5
DEBUG: Ember Data      : 2.5.2 
DEBUG: jQuery          : 2.2.3
@hhff
Copy link
Collaborator

hhff commented May 2, 2016

It should be
{{#each cards as |trademark|}}
right?

@paridin
Copy link
Author

paridin commented May 2, 2016

sorry i fix my typo, I copy from my component i try to simplify the html because is the same behavior

but it looks

{{!-- index.hbs --}}
{{#card-list cards=model}}
    {{infinity-loader infinityModel=model  destroyOnInfinity=true}}
{{/card-list}}
{{outlet}}
{{!-- components/card-list.hbs --}}
<div class="row" id='list-trademarks'>
{{#each cards as |trademark|}}
    <div class="col s12 m6 l4">
      <div class="card small" style='padding-top: 0 !important; margin-top: 0 !mportant'>

           {{card-limit-display relCards=trademark.marcanet title=trademark.title panref=trademark.id total=trademark.relatedTotal}}

        <div class="card-reveal">
          <span class="card-title grey-text text-darken-4">{{trademark.title}} similares.<i class="material-icons right">close</i></span>
          {{card-hidden hiddenCards=trademark.marcanet}}
        </div>
      </div>
    </div>
{{/each}}
{{yield}}
</div>

@hhff
Copy link
Collaborator

hhff commented May 3, 2016

This is probably a good issue for stack overflow. We try to keep github issues for problems in the library, rather than implementation details.

@hhff hhff closed this as completed May 3, 2016
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