Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Browse Table Filter Options Topic is solved

Questions related to using nuBuilder Forte.
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Browse Table Filter Options

Unread post by kev1n »

Do you see an error in the console (F12)?
Alohajoe5
Posts: 55
Joined: Tue Apr 16, 2019 1:32 pm

Re: Browse Table Filter Options

Unread post 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?
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Browse Table Filter Options

Unread post by kev1n »

[quote="Alohajoe5"Can you tell me where I need to edit the SQL?[/quote]
sql.PNG
You do not have the required permissions to view the files attached to this post.
Alohajoe5
Posts: 55
Joined: Tue Apr 16, 2019 1:32 pm

Re: Browse Table Filter Options

Unread post 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!
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Browse Table Filter Options

Unread post 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)
Alohajoe5
Posts: 55
Joined: Tue Apr 16, 2019 1:32 pm

Re: Browse Table Filter Options

Unread post 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.
Alohajoe5
Posts: 55
Joined: Tue Apr 16, 2019 1:32 pm

Re: Browse Table Filter Options

Unread post 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
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Browse Table Filter Options

Unread post by kev1n »

the SQL statement I posted last didn't contain the zzzzsys_object table.
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Browse Table Filter Options

Unread post 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 (;)
Alohajoe5
Posts: 55
Joined: Tue Apr 16, 2019 1:32 pm

Re: Browse Table Filter Options

Unread post 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
Post Reply