Dynamic database links (filters)

Using translator. Not a programmer. I tried to write without errors.

Apparently, this is not realistic without code, although it seems so from the very beginning. At least it works crookedly.

As a result, there is a base for 5k lines. 2 factories. 50+ groups. 150+ subgroups. I use 1 table and 1 database.
Manual in the menu to “poke” them is unreal! In addition, this will change in google docs and updated on the site (I already found how to do this).
It was required that the table show only the selected category / subcategory.

It should essentially look like a filter in any online store. There is 1 huge base. I chose a category - I got a list of subcategories. No frills. Just buttons and 1 table.

But the problem arose in the editor, when the built-in switch for dynamic pages did not see all the categories. (apparently did not create all the pages.)
He needed to sort the column with unique names. But still, he does not see all the subcategories (I noticed when I manually made the menu).

Then I thought that the list is suitable for these purposes, because it interacts with a dynamic page and database. I decided to push the buttons for navigation there, just there you can specify the column from where to take the data. In general, it turned out some kind of nonsense. For a week I went over the options available in the editor by typing. Without result. Sorting works weird. The filter parameters have incomprehensible values ​​that I have to enter myself (And is this the dynamics? I thought).
In general, the buttons showed the same thing, because in the database in this column the values ​​are the same. I thought he would display them unique and replace the link with this word, so that there would be a transition to another page. It’s not in vain that you specify in the URL url / xx / {group} / {subgrup}
He should have displayed a list of unique names from the entire database in 5k lines and replaced the word in the {group} link. This is a variable! not?
Okay. And without buttons, you can do the same. You can make links in the table and they work as they should, but you revel in the same problem that the table displays repetitions. If you tell her to display 1 column with 1 word, he will show it 5k times. And all you need is 1. Is he smart? It turns out not very. Is it not clear that the same word is 500 pieces, why display it 500 times? This is stupid. Okay. It doesn’t work like that.


I made a manual sketch through the links in the menu. That is how it should look, but he himself must understand. After all, there is a database.
It seems to me that the answer lies on the surface. It shouldn’t be that hard. Why aren’t the tools the same menu as the editor?


Я так понял сообщество у WIX большое да и функционал серьёзный… А Русских не видать.

Please post your Wix Editor URL so that Wix Mods from this forum can have a look at your site so it helps them to see what your issue is.

(It is only the Wix Admin/Mods from this forum who have permission to open your Wix URL.)

Also, just wondering what you meant by your last sentence that you left in Russian…

  • Я так понял сообщество у WIX большое да и функционал серьёзный… А Русских не видать.

  • As I understand it, the WIX community is big and the functionality is serious … And you can’t see the Russians.

As you mention dynamic page links in your header, then see these pages about linking to dynamic pages.
https://support.wix.com/en/article/linking-to-a-dynamic-page
https://support.wix.com/en/article/creating-a-unique-dynamic-page-url
https://support.wix.com/en/article/making-multiple-dynamic-page-urls-unique
https://support.wix.com/en/article/creating-an-index-page-for-your-dynamic-pages
https://support.wix.com/en/article/creating-a-dynamic-category-index-page
https://support.wix.com/en/article/what-content-will-my-dynamic-page-display

I have already seen almost all the links, except for one. URL must not end with the variable …/{}, but with the name …/{}/name.
Nothing changes. Uniqueness is always at the beginning, this is the root of …/x/{}/{}. And {}/{} changes according to the columns of the database. However, creating a menu for these pages from a repeater does not work.
My last message for my own, if they are found here =). In my language about Wix, there is little information on YouTube, and there are no forums at all.

[Here is the editor link](https://editor.wix.com/html/editor/web/renderer/edit/4fa0c171-34f6-4280-9dad-4e31f8587d40?metaSiteId=97cddca1-6317-4d13-9a4d-54c765a8ce67&editorSessionId=456ff418- e911e05fce1a & referralInfo = dashboard)

Я нашел такой код.

import wixData from 'wix-data';
$w.onReady(() => {
$w('#dataset1').onReady(() => {
count();
$w('#drop1 , #drop2 , #drop3').onChange(() => {
search();
})
$w('#button1').onClick(() => {
$w('#drop1 , #drop2 , #drop3').value = "";
$w('#dataset1').setFilter(wixData.filter())
.then(count);
});
function search() {
let filter = wixData.filter();
let zavod = $w("#drop1").value;
let group = $w("#drop2").value;
let groupsub = $w("#drop3").value;
if (zavod && zavod !== 'all') {
filter = filter.eq("zavod", zavod);
}
if (group && group !== 'all') {
filter = filter.eq("group", group);
}
if (groupsub && groupsub !== 'all') {
filter = filter.eq("group-sub", groupsub);
}
$w('#dataset1').setFilter(filter)
.then(count);
}
function count() {
let total = $w('#dataset1').getTotalCount();
if (total > 0) {
$w('#textCount').text = `${total} найдено.`;
} else {
$w('#textCount').text = "No result found!";
}
}
});
});

Он понятный. Но он не работает. Почему?