Complete code example for search and display of results and connecting an onClick in the results table to a Dynamic ITEM page

Hello and thank you in advance…
Does there exist anywhere here a complete and fully-functioning code example of the following scenario:

User searches a collection via an input object, the search is performed, a table is displayed with SORTED results, the user can click on a row or cell of the search results table and redirect to a dynamic item page that displays more information from that record in the collection. This is a very common scenario for database interfacing and I am guessing that you have a TON of users who could benefit from a complete example.

What I am requesting is a FULL CODE EXAMPLE, from start to finish, that includes …

  • all necessary import statements at the top

  • the User Input object to trigger the search

  • the subsequent collection search with a SORT of the data

  • the displaying of a table with the results

  • code to detect onClick event on a table ROW or CELL

  • code to determine the value of one of the cells in the clicked row or cell, to be used in…

  • code to redirect user to the dynamic ITEM page that corresponds to the item clicked in the search results table
    All I can find are little bits and pieces of code here and there in the WixCode section and in forum posts. There is nothing that shows a big picture.

The support and examples here are fantastic, but there is one imperative resource that is missing: What users need are big-picture, complete examples of CODE that show a CODED PROCESS from beginning to end, in one place .

I looked at your EXAMPLE site for creating a TABLE INDEX - which happens to also have clickable rows - and it is just a dynamic page displaying all the records, unsorted, in the collection. It has basically no functional examples using code.

**Does such a code example exist anywhere here… or can we get one? ** I am thinking a LOT of your users could benefit from the example I am requesting.

Please say YES! : -)
Thank you again, most kindly, Cynthia-

P.S. I am struggling to do this and I am so close, but there are a few critical pieces I cannot find to complete the task. I keep thinking I found the answer, but there is always something missing. As I said, I just get little bits and pieces here and there

2 Likes

Hello Cynthia

here’s some hints you can follow:

  • add a user input and a table that is connected to your collection
  • add the sort you want to the data set by clicking on manage dataset option or using code
  • add an event on the user input element (example: on key change event)
  • in that event get the value inputted and add a filter to the table’s data set based on this value
  • for the table add on row click event
  • on the click event get the row data
  • get the value of the field that connects to the dynamic page
  • use wixLocation.to() to link to this dynamic page

usefull links:

I hope this helps :slight_smile:
Know that this forum is specialized in guiding you through your wix code issues and not provide a full code. so they’re will be some coding you need to do :slight_smile:
however if you feel you’re not up to the challenge you can always hire a wixCode expert that’s waiting to help you get your website the way you want ! visit wix arena here

Best
Massa

Thank you kindly, Massa, for taking the time to write such a thorough reply to my request. I appreciate it

PREFACE: Please read the following in the nicest way. My intention here is to help WIX understand my request and not simply to complain or chew someone out. : -) I must also add that I have had quite a bit of invaluably-helpful assistance here in the forum from very professional, highly knowledgeable and generous WIX individuals and I am ever-so grateful to them.

I actually have a degree in Computer Engineering and have written 1000’s and 1000’s of lines of code in my 30-yr career. I was designing websites in the mid-90’s when one had to write everything by hand, and I was writing lengthy SQL code to interface with databases in the early 2000’s.

My issues here was not fear of coding, I promise : -) I was not asking anyone to write my code for me, per se. My issue was that there are huge holes in your resources/documentation, and many of your examples - though great examples - are isolated lines/a few lines of code that often do not show other imperative details of their use.

Good reference materials are essential and WIX has a large and thorough set of reference materials. Thank you. But a LOT of people learn through example. On my first pass working with WIX code, I found it really difficult to simply sit down and crank out a simple task in WIX code, from start to finish, without chasing numerous different threads for what wound up being incomplete answers and reading reference materials that only show one line of isolated sample code rather than showing that one line placed in a scene where it is used… and maybe even show a handful of different ways it is used. So much of the enormous amount of time I spent looking for answers could have been rendered unnecessary if there had been some more-thorough sample site examples .

And I am guessing the examples already exist…they just need to be published in the CODE section and labeled properly so they can be found – the importance of good labeling and descriptions of examples cannot be overstated!!!

I firmly believe that WIX could reduce the number of support requests through the forum if they published perhaps 8-10 multi-featured and complete - from start to finish - robust examples of the most common website scenarios… and I mean robust.

I have walked through a number of your sample sites and, though there are quite a few of them, and they are useful, many of them are inadequately labeled and what is missing are big scenarios where many of them are used at once. If examples like I am suggesting exist, then they are impossible to find. At least they have been for me. I have spent enormous amounts of time scouring this CODE support area and the user forum.

Just some thoughts. : -) I would be happy to speak with someone there on the specifics re: what I am referring to here, if you like.

Thank you again, Massa, most kindly, for your time and effort in answering my question.

Take care…
Cynthia-

P.S. I am going to re-post this reply in the Community Feature Requests forum as it really seems to make sense there.

2 Likes

Hi Pulaki, I am trying to find what you are searching exactly, and I agree with your opinions about wix forum. I am loosing too much time here to find basic solutions.

Hi Pulaki,
I too am having the same challenges are you (by the sounds of things) and that is why I was very interested in your posts. Did you manage to find a solution?

Cheers
Graham

I confirm that finding something one needs isn’t easy in the forum. The examples are explained to a minimum and not comprehensive for beginners.
I already spend weeks to find how to create a query with multi-referenced collections (sub-sub related database tables) and filter data. Nothing comes out right as I want to… and the way I have to create it isn’t logical at all especially when used to php and mysql…