首页 > 解决方案 > Aurelia Kendo Grid - 搜索栏不显示

问题描述

使用 Aurelia 和 Kendo UI,如何显示搜索栏?

我要这个:

在此处输入图像描述

但我得到了这个:

在此处输入图像描述

我想显示搜索栏,但我得到了一个“搜索”按钮。

剑道文档:https ://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/search.fields

我的例子:https ://gist.run?id=ede27170780f6d9116808aab52cf5b68

应用程序.html

<template>
  <require from="aurelia-kendoui-bridge/grid/grid"></require>
  <require from="aurelia-kendoui-bridge/grid/col"></require>

  <ak-grid k-data-source.bind="datasource"
           k-toolbar.bind="['search']">
    <ak-col k-title="name" k-field="name"></ak-col>
    <ak-col k-title="age" k-field="age"></ak-col>
  </ak-grid>
</template>

应用程序.js

export class App {
  constructor() {
    this.datasource = {
      data: [
          { name: "Jane", age: 30 }, 
          { name: "John", age: 33 }
      ],
      schema: {
          model: {
              fields: {
                  name: { },
                  age: { type: "number" }
              }
          }
      }
    };
  }
}

标签: aureliakendo-ui-grid

解决方案


您使用的是旧版本的 kenko ui。

更新了版本,似乎正在工作:

https://gist.run/?id=69af4f41d3606134e38741d54294330a


推荐阅读