nextPage() 方法 - 不起作用

nextPage() method - not functioning

我有一个包含超过 1000 条记录的数据源。当前查询页面大小为 100。

我需要遍历每一项,并尝试找到与用户输入相匹配的记录。相当简单的用例,但是,我似乎无法让脚本循环遍历页面,所以它只是在查询页面大小为 100 时完成循环,因此只搜索前 100 条记录。

我试过

app.datasources.Vehicles.nextPage();

在 for 循环的末尾,然后用新页面再次调用 regoExists,但它不起作用。 nextPage() 是如何在客户端脚本中使用的?

function regoExists(rego){
  var regoUp = rego.toUpperCase();
  regoUp = regoUp.trim(); 

  ds = app.datasources.Vehicles.items;

  for (var i in ds){
    if (ds[i].registration === regoUp){
      console.log(ds[i].registration + " equals " + regoUp);
      app.datasources.Vehicles.query.filters.registration._equals = regoUp;
      return true;
    } else {
      console.log(ds[i].registration + " does not equals " + regoUp);
      continue;
    }
  }
} 

与其遍历每条记录并对每条单独的记录执行查询,我建议在同一数据源中引入一个文本框小部件并将绑定设置为:

@datasource.query.filters.registration._equals

然后通过单击按钮或通过文本框小部件的 onValueEdit 事件加载数据源。如果注册值存在,估计会在table中返回,如果不存在,则不会返回任何记录。