Buy Now
Sign in

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

indesweb , February 01 at 20:15
Answered
indesweb

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!

P
Pigna
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!​
T
Twincarb
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
P
Pigna
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.​
P
Pigna
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
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
P
Pigna
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
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​
P
Pigna
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
  1. if there is no choice all records are show,
  2. if the user choice a value of dropdown1, all the records with that value are show,
  3. if the user choice a value of dropdown1 and a value of dropdown2, only the records with both those values are show​
I think that with the free search field can be the same but with the keywords.
P.​
indesweb
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.
Screenshot-2018-2-9_Todos_los_Servicios1.png
Screenshot-2018-2-9_Transdeco_-_Administracin.png
Screenshot-2018-2-9_Transdeco_-_Administracin5.png
Screenshot-2018-2-9_Transdeco_-_Administracin2.png[div]Screenshot-2018-2-9_Transdeco_-_Administracin3.png
Screenshot-2018-2-9_Transdeco_-_Administracin1.png
Screenshot-2018-2-9_Transdeco_-_Administracin4.png
Greetings to all!!
[/div]
P
Pigna
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
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
Screenshot-2018-2-9_Transdeco_-_Administracin6.png
admin
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
If your main question got answered then please mark the answer using the button!​
​Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
indesweb
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!!Screenshot-2018-3-5_Todos_los_Servicios.pngScreenshot-2018-3-5_Todos_los_Servicios1.png
Attachments
Screenshot-2018-3-5_Todos_los_Servicios.png
Screenshot-2018-3-5_Todos_los_Servicios.png
(19.1 KiB)
287 Downloads/Views
indesweb
Hello!
Any ideas??
Thanks