In developing the user interface for a web app, you must solve two fundamental problems. First, you must build everything fast, and second, the app must remain unique. There are plenty of web development tools that help to solve the first problem. Various frameworks and libraries, such as React, Vue.js, Angular, and Webix, are at your disposal when you need to build apps faster and more efficiently. The more demanding challenge is to make your app stand out from the competition. Here, you must spend a lot of time customizing the standard components libraries provide. For example, building such a familiar web app element as a complex user list that allows dragging items and opening user cards may require much effort. That’s why it’s more practical to create complex widgets as a combination of simple UI elements and reuse them in different parts of the application or even in other projects. For example, this popup contains a text editor, a simple drop-down element, and a drop-down element with a multi-select feature:

The more extensive app you build, the more complex functionality you need, and sometimes an out-of-the-box feature set can cover all your requirements. Nothing restricts you from creating as many widgets as you need. The question is, how to choose a development tool whose customization capabilities will make this task manageable?

Business Benefits of Using Webix in Your Projects

Building any custom web app component goes through the standard procedure of collecting requirements, negotiations, development, and testing, which extends the time between IDEA and its IMPLEMENTATION. In this case, Webix Table helps to save your time and money by using ready-made components that are easy to install and configure, which is a very beneficial feature for every business sphere. Compared to any other popular JavaScript library, where businesses have to customize components from scratch, in Webix Table, users meet a well-known interface with the possibility to embed new features with ease, as shown in the example with Search and Pagination below.

Often, UI libraries that provide access to ready-to-use UI elements have built-in paging in all components that involve working with a large amount of data. A data grid, for example, will most likely include much more data than a few lines can fit, which makes such an approach pretty useful. However, Webix uses a separate UI component for this. Such independence enables some additional advantages in configuration and customization for your needs. For example, you can specify the number of buttons to move to a specific page the app will show. Also, buttons that allow moving to the first or last page and those allowing you to open the next or previous page are under your complete control. You can enable paging anywhere in your web app and adjust the component’s appearance and functionality as you like.

Webix Table is ready to process big arrays of data without lags which can be very useful for such business areas as construction, real estate, logistics, and accounting. In such companies, users must handle large amounts of numerical data, display it in a structured view, easily define information by specific criteria, and sort and filter it. If you deal with data-rich applications where functionality prevails over appearance, you can also rely on Webix Table and its ability to reduce development time. Also, it can help to enlarge your income without wasting time developing a component from scratch.

Adding Extra Features to the Webix Table Component

There are many feature-rich Webix components. Here, you can find basic controls (buttons, checkboxes, or icons) and complex full-functional widgets (Kanban boards, Gantt charts, and pivot charts). However, sometimes they can only cover some of the developer’s needs.

In such cases, developers can combine simple components into complex structures for every UI they work on. Alternatively, they can find a way to build their own complex component and use it in all cases when it suits their needs. Creating your component is a preferred option since it simplifies and speeds up the development of a complex UI. In this article, we’ll discuss implementing a complex widget based on the Webix Table that provides such features as search and pagination.

So, our task is to implement a complex component for building tables. We want to combine it with some extra decorators, namely Pager and Search, so we need to ensure they can work with a particular table with no issues. With the Pager component, we can assign unique IDs to make everything work. On the other hand, with the Search component, the situation is more complex. However, the effort will be worth it. Further configuring the widget, adding styles, and displaying a list of users will allow you to get a web app element that looks like this:

First, we need to create the Pager component. It efficiently works with the Webix tables, so we only need to set a unique ID for using this component multiple times on the same page. Let’s set the Pager ID based on the table ID. For this purpose, we will use the getIdByRelatedView() method. Its purpose is to add the string ‘Pager’ to the table ID to ensure it remains unique. To learn more about how to work with constructors, check out this documentation page.

The next step is to build the Search component. We need to bind it to the Table component to ensure it works correctly. To pass IDs of related views, we’ll use this.data.relatedViewsId. In the applySearch function, we will call the tableSearch() method. The function itself will search values by its own search criteria related to the particular table.

Let’s get down to creating the table component based on the Webix Table. And, of course, we need to pass the Pager ID to the Table configuration. Once again, we will use the getIdByRelatedView() method to generate an ID for the Pager using the Table ID.

Also, in the Table constructor, we will implement the tableSearch function for searching using the fields we will pass from the outside.

To create the Complex Table component comprising the Table, Pager, and Search, we must combine all the above elements and make them work as a single mechanism. Additionally, we can make Search and Pager configurable. For example, let’s look at how it’ll work with the Pager:

And finally, we can use this brand new Complex Table component. For this, we need to pass the following settings:

  • the Table ID, also we will use it for the Pager;
  • the Table columns;
  • the Pager parameters (true if we need it, otherwise false);
  • the column ID for searching.
That’s how we can create multiple tables and adjust them to meet our requirements.

Moreover, these are not ordinary tables. They can interact with other components and have extra functionalities. Also, we can work with them quickly and conveniently.

Do you need to see the full project source code? Check the files compiled by our developers.

Conclusions

We have provided you with an example of building a complex Webix component that you can give any name you want. For instance, we can name it customComplexTable. Following the described approach, you can build any unique complex component for your needs and easily avoid code duplication problems.

Contact us if you’re looking for an experienced team of Webix developers to modernize your software system or build a new one from scratch.