Thank you, it is working now, but i want to find with multiple search field with or function as mentioned in Ziv, post, please give me coding for the same
I'm wanting to make a search for a table on each page of my website, but I want it to automatically make the results appear on the table below as I type in keywords, or parts of keywords.
I also want it to 'magically' - LOL - make the search unhappen as you delete the keywords in the search bar.
Hello, I've gotten the code to work but it only works in preview and not on the live site? My live database is the exact same as my sandbox database. Any help is appreciated
Â
EDIT: Solved it with setting permissions to Anyone can view
I desperately need help, my search bar is pulling info from my database, it is not going through the dataset on the page, so it isn't filtering results.
Is there a way to have one of your columns be a hyperlink? I have an idea that the table from the dataset will be websites, for this to work I will need to make it a clickable link that opens in a new browser. Do you know if code could make the fields in a column be able to be a hyperlink?
I am also trying to build a search function on my site but I am also having problems. I have read all of the posts but for some reasons I cannot get the search to return any data in my table.
Â
I entered basic search code and also have a commented out section for the more complex search. My published site is:
I am having problems trying to get search database and return table results code to work. I have used every code example I have found on the forums and none of them seem to work. I could really use some help. Table is #table1, input box is #searchInput.
Hi Yoav,
Â
Â
i am unable to do search , although already used all coding as per described by you My website : https://gdexindia.wixsite.com/gdexindia11 editor : https://editor.wix.com/html/editor/web/renderer/edit/7b1a1493-bd68-433a-889f-7c382be000cc?metaSiteId=cc46de08-d072-4d32-896e-6612cf62d781&editorSessionId=246D118A-8C69-4713-BA8C-505CF3C4A65F coding : //For full API documentation, including code examples visit http://wix.to/94BuAAs $w.onReady(function () { //TODO: import wixData from 'wix-data'; }); export function searchButton_onClick(event) { wixData.query('Member-database') .contains('name', $w('#input1').value) .find() .then(res => { $w('#table1').rows = res.items; }); Please do the needful Regards Rajesh Dudhat
Hi gdexindia,
You're search returns nothing because you're looking for a field call 'name', but the actual field key is 'Name' (it's case sensitive).
See here:
Â
Â
Â
Please note that the Name Value itself is also case sensitive.
This means that looking for 'Dud' is different that looking for 'dud'.
Consider using toLowerCase() for this.
Â
Hope this helps,
Liran.
Hi Nayeli,
i am unable to do search , although already used all coding as per described by you My website : https://gdexindia.wixsite.com/gdexindia11 editor : https://editor.wix.com/html/editor/web/renderer/edit/7b1a1493-bd68-433a-889f-7c382be000cc?metaSiteId=cc46de08-d072-4d32-896e-6612cf62d781&editorSessionId=246D118A-8C69-4713-BA8C-505CF3C4A65F coding : //For full API documentation, including code examples visit http://wix.to/94BuAAs $w.onReady(function () { //TODO: import wixData from 'wix-data'; }); export function searchButton_onClick(event) { wixData.query('Member-database') .contains('name', $w('#input1').value) .find() .then(res => { $w('#table1').rows = res.items; }); Please do the needful Regards Rajesh Dudhat
Hi gdexindia,
Just answered you're question. see my previous comment.
Â
Liran.
Hi Liran,
Â
Thank you, it is working now, but i want to find with multiple search field with or function as mentioned in Ziv, post, please give me coding for the same
I've noticed it is case sensitive. Can you make the search so it doesn't have to match exactly?
Â
Hi Dale,
Â
wixData query is currently case sensitive, and it is not possible to modify it.
Â
As a workaround, you can modify your collection text to lower case and simply call toLowerCase() on the search strings.
Â
Â
Â
Â
Good afternoon. What I want is to open a new page
Â
if it finds the word entered in the input in the database. The url of the new page corresponds to the "Link" column of the database
Â
Â
Â
Â
Hello Yoav,
Â
Can you please help me as well.
Â
1. I created a collection, import all my products to the collection via CSV,
2. Add a gallery to a page
3. Connected the dataset to my collection
4. Connected the Gallery to dataset
Â
But I am unable to add a “Sort” option above the Gallery.
All I need is to connect two buttons “Price Low | High” to the Gallery.
Â
I would really like to add Sort button so my customers would be able to click on to sort the list.
Â
Â
I did receive the code but when I added it to the end of the page it is not working for some reason.
I clicked on the Gallery
Clicked on onCurrentitemChanged on the properties panel
Pasted the whole script after the the lat }
Â
import wixData from 'wix-data';
Â
$w.onReady( function() {
$w("#button227").onClick( (event, $w) => {
$w("#dresses1").setSort( wixData.sort()
.descending("price");
} );
Â
$w("#button228").onClick( (event, $w) => {
$w("#dresses1").setSort( wixData.sort()
.ascending("price");
} );
} );
Â
Â
Â
This is the page I am working on.
https://deli236.wixsite.com/sweetsmilecopy/dresses
Â
Can you please have have a look at this.
Â
Many thanks
Hi
I'm wanting to make a search for a table on each page of my website, but I want it to automatically make the results appear on the table below as I type in keywords, or parts of keywords.
I also want it to 'magically' - LOL - make the search unhappen as you delete the keywords in the search bar.
Any help will be so amazing!
Many thanks
Sarah
Hi, how can I redirect the result into a dynamic page instead of table?
Â
Â
Hello, I've gotten the code to work but it only works in preview and not on the live site? My live database is the exact same as my sandbox database. Any help is appreciated
Â
EDIT: Solved it with setting permissions to Anyone can view
I desperately need help, my search bar is pulling info from my database, it is not going through the dataset on the page, so it isn't filtering results.
Any help would be greatly appreciated!
Â
Â
Hey guys, sorry, I'm still stuck! I type in the search box, click Search and nothing happens. Here's my code; have any idea of where I'm going wrong?
Â
import wixData from 'wix-data';
export function button1_onClick() {
let searchValue = $w('#input1').value;
let searchWords = searchValue.split(' ');
let query = wixData.query('recipes')
.contains('physicalIssue', searchValue);
Â
for (let i=1; i < searchWords.length; i++) {
query = query.or(wixData.query('recipes')
.contains('title', searchWords[i]));
}
Â
query.find()
.then(res => {
$w('#table1').rows = res.items;
});
}
client's account: dtcoyne@comcast.net site: dishofftheblockdraft
Â
Is there a way to have one of your columns be a hyperlink? I have an idea that the table from the dataset will be websites, for this to work I will need to make it a clickable link that opens in a new browser. Do you know if code could make the fields in a column be able to be a hyperlink?
This is the code I am using.
Â
import wixData from 'wix-data';
//For full API documentation, including code examples visit http://wix.to/94BuAAs
$w.onReady(function () {
//TODO: import wixData from 'wix-data';
});
export function searchButton_onClick(event) {
wixData.query('mychurch')
.contains('churchName', $w('#input1').value)
.find()
.then(res => {
$w('#table1').rows = res.items;
});
}
This is the table, I want the last column (store website) to be websites with clickable links
Â
Â
Hi Shanette, I've same problem. Could you share the solution with me If you've already solved?
HI,
Â
I am also trying to build a search function on my site but I am also having problems. I have read all of the posts but for some reasons I cannot get the search to return any data in my table.
Â
I entered basic search code and also have a commented out section for the more complex search. My published site is:
Â
https://seranpearson.wixsite.com/mysite-2
Â
I am trying to get the search on the home page to work. Any help on this much appreciated.
Â
Thanks
Â
Seran.
Hi Seran.Pearson,
Â
Try this one: https://www.totallycodable.com/forum/codes-for-templates/search-this-or-that-code-table-results
Â
You connect your table to a dataset then edit the code.
Â
Good luck : )
I am having problems trying to get search database and return table results code to work. I have used every code example I have found on the forums and none of them seem to work. I could really use some help. Table is #table1, input box is #searchInput.
Â
import wixData from 'wix-data';
Â
export function Button9_onClick() {
wixData.query('carrierpacket')
.contains('columnIdName', $w('#searchInput').value)
.or(wixData.query('carrierpacket').contains('company_name', $w('#searchInput').value))
.or(wixData.query('carrierpacket').contains('Company_contact', $w('#searchInput').value))
.find()
.then(res => {
$w('#table1').rows = res.items;
Â
$w("#table1").columns = [
{
"id": "col1",
"dataPath": "company_name",
"label": "Company Name",
"width": 100,
"visible": true,
"type": "string",
"linkPath": "link-field-or-property"
},
{
"id": "col2",
"dataPath": "company_contact",
"label": "Company Contact",
"width": 100,
"visible": true,
"type": "text",
"linkPath": "link-field-or-property"
},
{
"id": "col3",
"dataPath": "mcnumber",
"label": "MC Number",
"width": 100,
"visible": true,
"type": "text",
"linkPath": "link-field-or-property"
},
];
} ------- I receive a red error
Hi... I have implemented the search function in my website. Do i have to add any coding because of the new server side rendering that wix introduced.
Â
Thanks in advance!