Welcome, Guest
Please Login or Register.    Lost Password?

Search Form Question
(1 viewing) (1) Guest
Welcome to the ToolsJX forum!


Go to bottomPage: 1
TOPIC: Search Form Question
#342
Search Form Question 4 Months, 3 Weeks ago Karma: 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
KawasakiMike9
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#343
Re:Search Form Question 4 Months, 3 Weeks ago Karma: 1
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
viljem
Admin
Posts: 145
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#344
Re:Search Form Question 4 Months, 3 Weeks ago Karma: 0
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
KawasakiMike9
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#345
Re:Search Form Question 4 Months, 3 Weeks ago Karma: 1
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['output_script'] .=
" ><span class=\"field\">&nbsp;<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
viljem
Admin
Posts: 145
graph
User Offline Click here to see the profile of this user
Last Edit: 2010/03/06 05:06 By viljem.
The administrator has disabled public write access.
 
#348
Re:Search Form Question 4 Months, 3 Weeks ago Karma: 1
Is there any way to run the AJAX with the query in the GET variable as the page loads.

Yes, you just have to specify two GET variables

Code:

?data_search=mysearchstring&s_f=0


where data_search contains your search string and s_f specifies your search field. If you want to search throuhg all fields you set it to 0 as shown in the example above.
tomaz
Expert Boarder
Posts: 82
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2010/03/07 06:57 By tomaz.
The administrator has disabled public write access.
 
Go to topPage: 1
Tools JX, Powered by Joomla!; Joomla templates by SG web hosting