简体   繁体   English

Oracle-JET:如何使用 oj-paging-control 将内容动态添加到 oj-list-view

[英]Oracle-JET : How do I dynamically adding content to oj-list-view using oj-paging-control

I want to fetch data based on the page number.我想根据页码获取数据。 ie I check if page no.即我检查是否页码。 is 1, make an API call which returns 1-100 output rows and those are displayed in the list-view.为 1,进行 API 调用,返回 1-100 output 行,这些行显示在列表视图中。 Whenever page number is changed, a function is called (I will make a new API call there to load next 100 output rows into the ArrayDataProvider).每当更改页码时,都会调用 function(我将在此处调用新的 API 以将下一个 100 个 output 行加载到 ArrayDataProvider 中)。 Is there a way to capture the value of page number in and also call a function every time it changes?有没有办法在每次更改时捕获页码的值并调用 function ?

HTML HTML

<oj-paging-control id="paging" data='[[pagingDataProvider]]' page-size='100'></oj-paging-control>
<oj-list-view id="listview" data="[[pagingDataProvider]]">
     <template slot="itemTemplate" data-oj-as="item">
     <oj-list-item-layout id="listitem">
     <oj-bind-text value="[[item.data.VALUE]]"></oj-bind-text>
     </oj-list-item-layout>
     </template>
</oj-list-view>

JS JS

var a = makeAjaxCall(url, Object.assign({},reqParams, {data: {this.data},dataType: "json"}));
            a.then((response)=> {
                 var data = response.split("\n")
                 while(data[i]!="")
                 {
                 this.listOutput.push({
                    "VALUE":data[i]                     
                 });
                 pagingDataProvider(new ArrayDataProvider(this.listOutput, {keyAttributes: 'VALUE'})); 
                 }

This use of paging control is deprecated, the only use supported is the dots version which can be used with filmstrip.这种分页控制的使用已被弃用,唯一支持的使用是可以与幻灯片一起使用的点版本。 High water mark scrolling is the supported way to load more data in JET.高水位标记滚动是在 JET 中加载更多数据的支持方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM