如何从 W2UI 网格工具栏中删除搜索和刷新字段?

How to remove search and refresh fields from W2UI grid toolbar?

W2UI 网格组件具有打开工具栏的选项。不幸的是,它包含两个我不想要的字段,并占据了我没有的 space。这两个字段是搜索和刷新。你可以看到他们 here.

如何关闭它们?我试过从 w2grid 定义选项中删除“搜索”项,但搜索字段仍然存在。有没有人知道如何隐藏这两个字段?

可以通过 grid.show.

隐藏这些工具栏元素

要删除搜索下拉菜单,请将 toolbarSearch 设置为 false。

要删除搜索输入字段,请将 toolbarInput 设置为 false。

要删除刷新按钮,请将 toolbarReload 设置为 false。

这是根据您链接的演示修改后的 show 属性:

    show: { 
        toolbar: true,
        footer: true,
        toolbarAdd: true,
        toolbarDelete: true,
        toolbarSave: true,
        toolbarEdit: true,
        toolbarSearch: false,
        toolbarInput: false,
        toolbarReload: false,
    },

grid.show 文档可在此处找到:http://w2ui.com/web/docs/1.5/w2grid.show

Fiddle: http://jsfiddle.net/g5ebyqdv/