Forums

How can I add search or filter fields to your Connectivity 6 list?

indesweb 01 Feb, 2018
I tried to do it with the tutorials of CCv5 and earlier, it does not work for me.
It shows me the simple form, but the button does nothing.

Tried from here: https://www.chronoengine.com/faqs/72-chronoconnectivity/ccv5/5217-adding-search-or-filter-fields-to-your-listing

Can someone help me? I can not get anything to work, and after reading the forum, and trying things, I think I've become more involved.

Thank you!
Pigna 07 Feb, 2018
Hi!

I've the same problem, i've read other topics about it but I don't understand. In the index event i've a table view with many columns (populated by a db read with two where conditions) and I want made a dropdown filter with the values of one column. I had made it in CV5 with the tutorial but i realy don't understand how make it with CV6.

Can anyone help?


Thank you!
Twincarb 07 Feb, 2018
3 Likes
To use the search facility is quite simple, you will need the following elements:
View
Function
Event
From the View page, select "Widgets" - "Search"
To keep it simple just change the name to search - it then needs to be linked to the Event that you want it to appear in
Select "Events" then select the event you want the search to appear in.
add to the content box
 {view:search}
this is the parameter that will display your search box.

I am going to presume you already have a view setup, in the very basic scenario you should have something like:
{fn:read_data_my_data}
{view:search} 
{view:table1}
you now need to add the configuration that you need to the function that you are calling, for this there are 2 options.
1. scroll to the bottom of the function page and add the model.field that you want to search in. (the field is the field from the database you want to search in that is related the the model that queries the database) you can search in more than one Model if you want to.
Model.field:{data:keywords}
If you add more than 1 "search term" in the search field when it is processed the database query treats it as an AND this means your searching for the same term in each field. If that isn't your desired query then you need to use option 2.

2. At the top of the function is the Where conditions simply add the search terms (in the Model.Field format) as below
model.field:{data:keywords}
OR
model.field:{data:keywords}
OR
model.field:{data:keywords}
the term {data:keywords} doesn't need to be changed unless you change the search parameter name in the function view.

Once you have completed the above, add {debug:} to the "View" this will allow you to see what is being queried and assist in debugging problems.
I think I am correct in thinking that if you have limited the "Fields to be retrieved" then your limited to searching in those areas only.

Regards,
Dave
Pigna 07 Feb, 2018
Thank's Dave!

I've followed your instructions and now I have the search field; i've to put only "model.field" in the function search box, without "{data:keywords}", but now it works.

Now I will try to replace the open search field with a dropdown field.

P.
Pigna 08 Feb, 2018
Ok, I've got it. I've copy the html code of the search box and pasted it in a "custom html" view. I've replaced the text field with a dropdown field and it's work perfectly.

Then I moved the conditions in the "where conditions" box because i need to create a second dropdown filter. I've changed the condition with "model.field:{data:name_of_dropdown_field}/-" and add the condition for the second dropdown likewise.

Everything works fine.
indesweb 08 Feb, 2018
Hello!
Twincarb your answer has been fantastic! I have finally learned to put a search engine.
The Widget Search already had it but put very badly. And I did not have the conditions as you described.
Thank you very much!

One question: we have created a search engine with

model.field: {data: keywords}
OR
model.field: {data: keywords}
OR
model.field: {data: keywords}

How do I put it so that only one is searched for several cases?
Name ---- model.field: {data: keywords}
Job post ---- model.field: {data: keywords} ??
I explain, how do you set to differentiate the "keywords"?
I understand that I put Input1 and it is keywords1; Input2 is keywords2.
Where do you put that input you have to look only in the column that I say?

Or with a drop-down? For example "schedule" the value of dropdown1 is keywords3.

And then in terms of my table I can put for example:
model.name: {data: keywords1}
model.puesto: {data: keywords2}
model.horario: {data: keywords3}

Does anyone know how to put them one by one? How to create a filtering between several columns?

Thanks in advance
Pigna 08 Feb, 2018
Hi indesweb!

my english is not very good so I should haven't properly understand what you need. Do you want two search fields (or two dropdown), one for search through column A (es: puesto) and one for search through column B (es: horario)?
indesweb 08 Feb, 2018
Yes!! He was an example. that could be with any other field as well, like dates or any other column that has my table.

I put a visual example more or less
Name      | Position  | Schedule  | Date of registration | ...
["input"] | ["input"] | ["input"] | ["input"]            | ["input"] |

Do not explain myself better .. sorry
Pigna 08 Feb, 2018
1 Likes
I've done it with dropdowns.

In the "Where conditions" (not in "Searchable fields") of the db read I've put
model.field1:{data:dropdown1_name}/- 
model.field2:{data:dropdown2_name}/- 

I don't have keywords, only the values of the two dropdowns options.

"/-" is for the empty value.

So[ol][li]if there is no choice all records are show,[/li][li]if the user choice a value of dropdown1, all the records with that value are show,[/li][li]if the user choice a value of dropdown1 and a value of dropdown2, only the records with both those values are show
[/li][/ol]
I think that with the free search field can be the same but with the keywords.

P.[br]
indesweb 09 Feb, 2018
Good !!
I'm trying what you say excited.

Load the values in the achieved dropdown!
I had to look at the post # 371109, but achieved!



And I'm putting in "Where conditions" of my data reading, but I do not look for anything when I hit the button.


I tried to remove what I had from the search engine, in case everything failed together, and nothing, I left blank.

Then I put it together, and it does not work either.



I'm sure I've eaten something, but I'm reviewing forum posts with what I have and I do not see it.

Do we have to configure the search buttons somewhere?


I attached screenshots for anyone who can help or be helpful.

notice if someone wants to copy something, that the paginator does not work for me. I do not know why either.









Greetings to all!!🙂
Pigna 09 Feb, 2018
I've done directly with a custom html (I'ive only the html form and the where conditions), i put the code, so you can see the form action/metod and the button.
<form action="https://www.sitedomain.com/page/index.php?option=com_chronoconnectivity6&view=connection&Itemid=260&conn=avvisiaperti" method="post" name="search21" id="search21" data-id="search21" class="ui form"><div class="fields">
<div class="field">
<label for="provincia">Provincia</label>
<select name="provincia" id="provincia" value="" data-inputmask="" data-load-state="" data-tooltip="">
<option value="">Tutte</option>
<option value="6">Alessandria</option>
<option value="5">Asti</option>
<option value="7">Biella</option>
<option value="4">Cuneo</option>
<option value="3">Novara</option>
<option value="1">Torino</option>
<option value="8">Verbania</option>
<option value="2">Vercelli</option>
</select>
</div>

<div class="field">
<label for="oggetto">Oggetto</label>
<select name="oggetto" id="oggetto" value="" data-inputmask="" data-load-state="" data-tooltip="">
<option value="">Tutti</option>
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
</select></div>

<div class="field">
<label for="filtra" style="visibility: hidden;">Filtra</label>
<button name="filtra" id="filtra"class="ui button green">Filtra</button></div>

</div>
</form>

I wish can help you.
indesweb 09 Feb, 2018
Answer
Hello!

Thanks for the help Pigna, but it does not work for me, I do not know what happens to me that the buttons do not work.
The only thing they do is refresh the web.

I do not know why "search" if it works and doing with Views> Form> fields does not work ...

I see very white form, it seems to me that it is because I do not know what to put there.

I've been guiding myself through several posts and I've been more than before.

Does anyone know how to put "form" to send the values to do the filtering?

I think I have that wrong, because the rest I have been riding little by little with all the help you have given me, and in the form I do not have data on how it works.

I have Name, Category, Content = {view: cells_filter}

And I have nothing in Event, nor Action, nor data provider.

I understand that data provider has to be empty because the user enters the data.

Event I have nothing because I call the form from the header.

And action I do not understand very well, that I have to put there. Or if I do not have to put anything.

I often messed up alone
Max_admin 19 Feb, 2018
Hi indesweb,

For the form to work you must have an "event" or "action url", this is where the form will send the data, but you have both empty.

Also if you can post a url to the page with the problem then I can check it for you.

Best regards
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
indesweb 05 Mar, 2018
Hello everyone

I have managed to make a search engine with another read data different from the view of my table because otherwise the values of the table disappear as seen in the above image.

After giving it many laps, I have not managed to see the table with the binder. The search engine works but it is not logical a table without values and a search engine, and that is why I have created another read data and another table for the search engine, but as you will see in the image it is not pretty.

How can I put a button that when you download the search engine and the results table?


And if I do a search, I do not get the aid!because it can be?Where can I fix it?

Thanks in advance!!
indesweb 20 Mar, 2018
Hello!

Any ideas??

Thanks
amheng5 11 Feb, 2019
Hi, I have followed your instructions to the letter; however, when I try a search term, it shows the whole table rather than the records I want the search. I have the search field appearing as expected at top of my table of all records.

Here's my setup:

Events Tab
created "view_search"
{fn:read_records}
{view:search_button}
{view:search}
{view:table1}

Views Tab
Search Widget - default settings
Table - searchResults
data provider: {var:search-results}
column list: model.field:{view:sort_birthyear}

Functions tab
Read Data: search_records
Where conditions model.field:{data:keywords}
Fields to Retrieve blank
Searchable Fields model.field

Your advice would be appreciated.
This topic is locked and no more replies can be posted.