简体   繁体   English

CRUD 应用程序中网格的替代品?

[英]Alternatives to grids in CRUD applications?

So you were assigned to build a basic CRUD application.所以你被指派构建一个基本的 CRUD 应用程序。 And it has this one page that serves to list all of the inventory items... if your user wants to edit any of them, there's the "Edit" button next to every item.它有一个页面,用于列出所有库存项目……如果您的用户想要编辑其中任何一个,每个项目旁边都有“编辑”按钮。

You know the drill.你知道演习。

I was recently tasked to modified one of such CRUD page and it looked rather ugly.我最近的任务是修改其中一个这样的 CRUD 页面,它看起来相当难看。 So I decided it could use some polishing.所以我决定它可以使用一些抛光。

But thinking about it... I wonder what are the good alternatives to using grids when creating a CRUD page that display a lot of data?但是考虑一下......我想知道在创建显示大量数据的 CRUD 页面时使用网格的好的替代方法是什么?

Setting aside ajax/speed/security/implementation concerns...抛开ajax/速度/安全/实施问题......

What are some good alternatives to using a grid in large CRUD pages?在大型 CRUD 页面中使用网格有哪些好的替代方法?

I'm willing to trade some usability for aesthetics if that would matter.如果这很重要,我愿意用一些可用性来换取美学。

For displaying relatively few fields for a lot of records, there's nothing wrong with a tabular display like a grid, especially if the task involves searching for or comparing records.对于为大量记录显示相对较少的字段,像网格这样的表格显示没有任何问题,尤其是当任务涉及搜索或比较记录时。 There is something wrong with Edit buttons to open a separate window or page for editing.也有一些错误的编辑按钮打开一个单独的窗口或页面进行编辑。 It means the user has to learn two windows and how to navigate between them, and it takes longer to do.这意味着用户必须学习两个窗口以及如何在它们之间导航,而且需要更长的时间。

A big usability improvement is edit-in-place: rather than a read-only grid, have an array of appropriate controls for the fields (text boxes, check boxes, comb boxes, etc.) within your grid (or instead of your grid).一个很大的可用性改进是就地编辑:而不是只读网格,为您的网格(或代替您的网格)中的字段(文本框、复选框、组合框等)提供一系列适当的控件)。 A single Save button on the page saves all changes to all records (or you post changes automatically for appropriate events).页面上的单个“保存”按钮可保存对所有记录的所有更改(或者您为适当的事件自动发布更改)。

Form-like layout (possibly tabbed) is the alternative to a tabular layout if you need to display lots of fields for few records.如果您需要为少量记录显示大量字段,则类似表单的布局(可能是选项卡式)是表格布局的替代方案。 You can provide paging controls (eg, something that looks like a Recordset control) to allow the user to page among records.您可以提供分页控件(例如,看起来像 Recordset 控件的东西)以允许用户在记录之间进行分页。

If you have lots of records and lots of fields, you can combine the tabular with the form-like layout by having a master-detail combination.如果您有很多记录很多字段,您可以通过主从组合将表格与类似表单的布局结合起来。 A table at the top of page displays the key fields for the records while a form at the bottom of the page display “overflow” fields for whatever record in the table currently has focus.页面顶部的表格显示记录的关键字段,而页面底部的表格显示表格中当前具有焦点的任何记录的“溢出”字段。

Another alternative is to display the records graphically.另一种选择是以图形方式显示记录。 Pick two fields and represent their values for each record by x and y coordinates used to locate an icon on the page.选择两个字段并通过用于在页面上定位图标的 x 和 y 坐标来表示每个记录的值。 This is good if the task involves searching for patterns or inter-related records.如果任务涉及搜索模式或相互关联的记录,这很好。 Additional fields for the record (icon) with focus may be shown in form-like layout in a detail portion of the page.具有焦点的记录(图标)的附加字段可以在页面的详细信息部分以类似表单的布局显示。

Another thing you can do is represent certain fields graphically within a tabular or form-like layout (eg, with icons, mini bar graphs, shade or color coding, etc.).您可以做的另一件事是在表格或类似表单的布局中以图形方式表示某些字段(例如,使用图标、迷你条形图、阴影或颜色编码等)。 This can aid user searches for records with certain values.这可以帮助用户搜索具有特定值的记录。 It can also display the general gist of a lot of data in a small space (eg, as sparklines).它还可以在很小的空间内显示大量数据的一般要点(例如,作为迷你图)。

Pick the layout that maximizes user performance for your users, tasks, and work environment.为您的用户、任务和工作环境选择可以最大化用户性能的布局。

A list (instead of a grid) that opens up more fields for editing when clicked, or opens a new window or form.单击时打开更多字段进行编辑的列表(而不是网格),或者打开新窗口或表单。 This way the screen isn't overloaded with data from the start, and it's very usable as long as the most important data is usable.这样屏幕从一开始就不会被数据过载,只要最重要的数据可用,它就非常有用。

An example would be the Gmail Chat contacts list (screenshot here ).例如,Gmail 聊天联系人列表(此处为屏幕截图)。

In some applications a very nice usability touch that helps reduce the information needed to display is a good search/filter box: as you type into the box, the list is filtered to matching entries.在某些应用程序中,一个非常好的可用性触摸有助于减少显示所需的信息是一个很好的搜索/过滤框:当您在框中键入时,列表会被过滤到匹配的条目。

The data to be displayed are tabular data, so it makes sense to display them in table form, I can't see any other acceptable solution.要显示的数据是表格数据,因此以表格形式显示它们是有意义的,我看不到任何其他可接受的解决方案。

However, different solutions can be combined to present the data in a functional way:但是,可以组合不同的解决方案以功能方式呈现数据:

  • If your main data table retrieves and shows some data coming from a relational MySQL table you can display them in a collapsible nested table如果您的主数据表检索并显示来自关系 MySQL 表的一些数据,您可以将它们显示在可折叠的嵌套表中
  • The native browser scrollbars are a bit ugly, you can use some Javascript plugins like OverlayScrollbars to improve the user experience浏览器原生滚动条有点丑,可以使用一些Javascript插件如OverlayScrollbars来提升用户体验
  • Some MySQL data have to be displayed at first sight, the main important information, whereas others are secondary data, details which can be displayed only if the user want to see them.一些 MySQL 数据必须第一眼显示,即主要的重要信息,而其他数据则是次要数据,只有在用户想要查看它们时才能显示详细信息。 I use another plugin for this purpose that adds a first column to the table, when you click it it shows a collapsible row with the additional secondary data.为此,我使用另一个插件将第一列添加到表格中,当您单击它时,它会显示一个带有附加辅助数据的可折叠行。
  • At last, if you wish you can stick the table main header to the top for the user can always see the columns titles.最后,如果您愿意,可以将表格主标题粘贴到顶部,以便用户始终可以看到列标题。

You can see all these tricks in action here in the MySQL Sakila database demo .您可以在MySQL Sakila 数据库演示中看到所有这些技巧。

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

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