Browse Table Filter Options

Questions related to using nuBuilder Forte.

Re: Browse Table Filter Options

Postby kev1n » Sat May 04, 2019 4:41 am

Do you see an error in the console (F12)?
kev1n
 
Posts: 236
Joined: Mon Oct 15, 2018 2:13 am

Re: Browse Table Filter Options

Postby Alohajoe5 » Sat May 04, 2019 4:51 am

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?
Alohajoe5
 
Posts: 55
Joined: Tue Apr 16, 2019 9:02 pm

Re: Browse Table Filter Options

Postby kev1n » Sat May 04, 2019 5:00 am

[quote="Alohajoe5"Can you tell me where I need to edit the SQL?[/quote]

sql.PNG
sql.PNG (17.87 KiB) Viewed 331 times
kev1n
 
Posts: 236
Joined: Mon Oct 15, 2018 2:13 am

Re: Browse Table Filter Options

Postby Alohajoe5 » Sat May 04, 2019 5:42 am

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!
Alohajoe5
 
Posts: 55
Joined: Tue Apr 16, 2019 9:02 pm

Re: Browse Table Filter Options

Postby kev1n » Sat May 04, 2019 2:43 pm

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)
kev1n
 
Posts: 236
Joined: Mon Oct 15, 2018 2:13 am

Re: Browse Table Filter Options

Postby Alohajoe5 » Mon May 06, 2019 9:41 pm

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 9:02 pm

Re: Browse Table Filter Options

Postby Alohajoe5 » Tue May 07, 2019 2:25 am

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
Alohajoe5
 
Posts: 55
Joined: Tue Apr 16, 2019 9:02 pm

Re: Browse Table Filter Options

Postby kev1n » Tue May 07, 2019 4:08 am

the SQL statement I posted last didn't contain the zzzzsys_object table.
kev1n
 
Posts: 236
Joined: Mon Oct 15, 2018 2:13 am

Re: Browse Table Filter Options

Postby kev1n » Tue May 07, 2019 4:12 am

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 (;)
kev1n
 
Posts: 236
Joined: Mon Oct 15, 2018 2:13 am

Re: Browse Table Filter Options

Postby Alohajoe5 » Tue May 07, 2019 4:25 am

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
Alohajoe5
 
Posts: 55
Joined: Tue Apr 16, 2019 9:02 pm

PreviousNext

Return to General