Page 2 of 8

Re: Browse Table Filter Options

Posted: Fri May 03, 2019 9:11 pm
by kev1n
Do you see an error in the console (F12)?

Re: Browse Table Filter Options

Posted: Fri May 03, 2019 9:21 pm
by Alohajoe5
Never mind, I've got the drop-downs to appear--now I'm on to editing the SQL. Can you tell me where I need to edit the SQL?

Re: Browse Table Filter Options

Posted: Fri May 03, 2019 9:30 pm
by kev1n
[quote="Alohajoe5"Can you tell me where I need to edit the SQL?[/quote]
sql.PNG

Re: Browse Table Filter Options

Posted: Fri May 03, 2019 10:12 pm
by Alohajoe5
kev1n wrote:[quote="Alohajoe5"Can you tell me where I need to edit the SQL?
sql.PNG

Thank you. I added the JavaScript to create dropdowns for indexes 3, 4, 5, & 9. These correctly populate. I've now edited the SQL to read:

Code: Select all

SELECT * FROM Channels; //Existing statement
SELECT * FROM zzzzsys_object
JOIN Channels ON zzzzsys_object_id = theid
    JOIN zzzzsys_tab ON zzzzsys_tab_id = sob_all_zzzzsys_tab_id
    JOIN zzzzsys_form ON zzzzsys_form_id = syt_zzzzsys_form_id
    WHERE

    ((sob_all_type = '#nuBrowseTitle0_dropdown#' AND LOCATE('#', '#nuBrowseTitle0_dropdown#') <> 1 )
    OR '#nuBrowseTitle0_dropdown#' = '' OR LOCATE('#', '#nuBrowseTitle0_dropdown#') = 1)

    AND

    ((sob_input_type = '#nuBrowseTitle1_dropdown#' AND LOCATE('#', '#nuBrowseTitle1_dropdown#') <> 1 )
    OR '#nuBrowseTitle1_dropdown#' = '' OR LOCATE('#', '#nuBrowseTitle1_dropdown#') = 1)
So effectively I only added my table name "Channels" to the JOIN statement. This does not seem to be working. I'm assuming I failed to edit other things under the WHERE clause, I'm just not sure what. By the way I REALLY appreciate all your help. Please keep it coming!

Re: Browse Table Filter Options

Posted: Sat May 04, 2019 7:13 am
by kev1n
It has to look like this. Replace the field in red with your field name (in your case the field name of column 3)

SELECT * FROM Channels
WHERE

((sob_all_type = '#nuBrowseTitle0_dropdown#' AND LOCATE('#', '#nuBrowseTitle0_dropdown#') <> 1 )
OR '#nuBrowseTitle0_dropdown#' = '' OR LOCATE('#', '#nuBrowseTitle0_dropdown#') = 1)

Re: Browse Table Filter Options

Posted: Mon May 06, 2019 2:11 pm
by Alohajoe5
kev1n wrote:It has to look like this. Replace the field in red with your field name (in your case the field name of column 3)

SELECT * FROM Channels
WHERE

((sob_all_type = '#nuBrowseTitle0_dropdown#' AND LOCATE('#', '#nuBrowseTitle0_dropdown#') <> 1 )
OR '#nuBrowseTitle0_dropdown#' = '' OR LOCATE('#', '#nuBrowseTitle0_dropdown#') = 1)
So my total statement now looks like this:

Code: Select all

SELECT * FROM Channels;
SELECT * FROM zzzzsys_object
JOIN Channels ON  zzzzsys_object_id = 5cbF608f24b3851
JOIN zzzzsys_tab ON zzzzsys_tab_id = sob_all_zzzzsys_tab_id
JOIN zzzzsys_form ON zzzzsys_form_id = syt_zzzzsys_form_id

WHERE

((Word = '#nuBrowseTitle0_dropdown#' AND LOCATE('#', '#nuBrowseTitle0_dropdown#') <> 1 )
    OR '#nuBrowseTitle0_dropdown#' = '' OR LOCATE('#', '#nuBrowseTitle0_dropdown#') = 1)
AND

((Type  = '#nuBrowseTitle1_dropdown#' AND LOCATE('#', '#nuBrowseTitle1_dropdown#') <> 1 )
    OR '#nuBrowseTitle1_dropdown#' = '' OR LOCATE('#', '#nuBrowseTitle1_dropdown#') = 1);
Still no success.

Re: Browse Table Filter Options

Posted: Mon May 06, 2019 6:55 pm
by Alohajoe5
FYI, the zzzzsys_object_id that I found, 5cbF608f24b3851, is the number I got by launching phpMyAdmin, opening the zzzsys_object table and ocating the object that is the "run"object for the Channels form that I have.

Further, I didn't notice having any tables/fields named zzzzsys_tab/zzzzsys_tab_id

Re: Browse Table Filter Options

Posted: Mon May 06, 2019 8:38 pm
by kev1n
the SQL statement I posted last didn't contain the zzzzsys_object table.

Re: Browse Table Filter Options

Posted: Mon May 06, 2019 8:42 pm
by kev1n
This is what it should look like:

Code: Select all

SELECT * FROM Channels

WHERE

((Word = '#nuBrowseTitle0_dropdown#' AND LOCATE('#', '#nuBrowseTitle0_dropdown#') <> 1 )
    OR '#nuBrowseTitle0_dropdown#' = '' OR LOCATE('#', '#nuBrowseTitle0_dropdown#') = 1)
AND

((Type  = '#nuBrowseTitle1_dropdown#' AND LOCATE('#', '#nuBrowseTitle1_dropdown#') <> 1 )
    OR '#nuBrowseTitle1_dropdown#' = '' OR LOCATE('#', '#nuBrowseTitle1_dropdown#') = 1)

Note that there is no final semicolon (;)

Re: Browse Table Filter Options

Posted: Mon May 06, 2019 8:55 pm
by Alohajoe5
kev1n wrote:This is what it should look like:

Code: Select all

SELECT * FROM Channels

WHERE

((Word = '#nuBrowseTitle0_dropdown#' AND LOCATE('#', '#nuBrowseTitle0_dropdown#') <> 1 )
    OR '#nuBrowseTitle0_dropdown#' = '' OR LOCATE('#', '#nuBrowseTitle0_dropdown#') = 1)
AND

((Type  = '#nuBrowseTitle1_dropdown#' AND LOCATE('#', '#nuBrowseTitle1_dropdown#') <> 1 )
    OR '#nuBrowseTitle1_dropdown#' = '' OR LOCATE('#', '#nuBrowseTitle1_dropdown#') = 1)

Note that there is no final semicolon (;)
Ok, now it seems like I'm making progress. For the "word column", for example--when I select "2" from the dropdown, the pagnation does indicate that I should be looking at a subset of records (goes from page 1/2060 to page 1/742), however the table displayed does not change to only display the records with 2 in the column. Also, selecting anything in the "type" dropdown does not further reduce the number of records--regardless of whether or not they are displayed.

Thanks for the help