- Posts: 4
- Thank you received: 0
Would it be possible for me to add the search field and button into a side module on my site and when it is clicked, go to the page that displays the table and displays the search results?
This is urgent so if you can help that'd be great.
Thanks
Please Log in or Create an account to join the conversation.
Hi,
you will have to change the code, no easy solution is possible.
My guess would be to pass parameters through URL and parse them before grid is displayed.
In GridBuilder.php (frontend), from line 188, variable $this->searchQuery
would be appropriate to change to parsed parameters from url (SQL code)
Best regards,
Viljem
Please Log in or Create an account to join the conversation.
Alright well I think I have it halfway figured out.
I set up a basic html form which sends it the variable to the next page with the search form on it. It enters the search term into the search box above the table but it doesn't run the query. I have to hit search again. Is there any way to run the AJAX with the query in the GET variable as the page loads.
I'd be willing to donate some money to TableJX if you could help me sort out this issue.
- Mike
Please Log in or Create an account to join the conversation.
Hi,
1. I would create another variable e.g. otherModuleParam in GridBuilder.php
2. Get parameters from URL and set otherModuleParam variable
3. In GridView.php which extends GridBuilder.php I would check if this variable is set (not null) and call ajax script on load
(now we have on click)
similar to:
$field .=
" ><span class=\"field\"> <b><a href=\"javascript:;\" onclick=\"SimpleAJAXCall('$grid_url&o_b=$conf_columns[$i]&o_d=$field[order_direction]&p=$this->page&s_f=$this->searchField&data_search=$this->searchStr&rpp=$this->rpp&ajax=1',SimpleAJAXCallback, '', 'data_listings$this->_ID');\" class=\"field\">";
from line 143 in GridView.php
But I didn't test this solution. You have to know here a little bit about javascript.
Best regards,
Viljem
Please Log in or Create an account to join the conversation.
Yes, you just have to specify two GET variables
?data_search=mysearchstring&s_f=0
Please Log in or Create an account to join the conversation.