0
大規模なJSONファイルを1000個以上のアイテムを持つビューにロードしようとしています。一度に20個。私がiron-list
を使用するたびに、ウィンドウのサイズを変更してjsonのすべてのアイテムを一度に読み込むまで、3つのアイテムしかレンダリングしません。iron-ajax、iron-list、iron-scroll-threshold経由のロードによるJSONファイルの処理
最初に20個のアイテムをどのようにレンダリングしてから、下にスクロールすると、もっと多くのアイテムが得られますか?
ありがとうございました。
<dom-module id="fetch">
<template>
<style>
:host {
display: block;
}
paper-card{
margin-bottom: 1em;
padding: 1em;
}
</style>
<h2>Hello [[prop1]]</h2>
<content class="horizontal">
<paper-material>
<iron-ajax
auto
url="/some.json"
handle-as="json"
last-response="{{ajaxResponse}}"
debounce-duration="300"></iron-ajax>
<iron-scroll-threshold on-lower-threshold="loadMoreData" id="threshold">
<iron-list items="[[ajaxResponse]]" scroll-target="threshold">
<template>
<paper-card>
<div id="card-content">
<h4>User:{{item.val}}</h4>
<h4>{{item.val2}}</h4>
</div>
<div class="card-action">
<paper-button>Icon</paper-button>
<paper-button>Like</paper-button>
<paper-fab>Open</paper-fab>
</div>
</paper-card>
</template>
</iron-list>
</iron-scroll-threshold>
</paper-material>
</content>
</template>
<script>
Polymer({
is: 'fetch',
properties: {
prop1: {
type: String,
value: 'fetch'
},
}
});
</script>
</dom-module>
を、私はその部分を通り抜けたが、私は完全に今のところ、そのライブラリをあきらめたので、私は「火」に未定義になるだろう。コアコンポーネントに一貫性がない場合、複雑なアプリケーションを構築するのに十分なほど安定していません。 – SinSync
あなたのコンテナまたは 'iron-list'に明示的なサイズを指定するだけで、イベントを発生させる必要はありません。あなたの 'iron-list'が別の要素の一部である場合、' this。$$( 'iron-list') ' –