NetTalk Central

Author Topic: Basic Filtering  (Read 2927 times)

eas9898

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Basic Filtering
« on: June 12, 2014, 07:03:17 AM »
Hi guys,

I am new to NT, and am trying to piece together a basic site that will allow users to browse a single table.  I have something up and running, but it only uses column sorting and locators which is not what I want.

Is there a way to have some basic filter options that are not locators?

For example, I have a date column, and I'd like to place two filter entries on the page, such as From Date and To Date.  Then, using those two fields, filter the table.

Or also maybe have an option, that depending on the value, I can pass something to the filter.

Or maybe there is an example app that demonstates this?

Many thanks,
Eddie

debzidoodle

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
    • Email
Re: Basic Filtering
« Reply #1 on: June 12, 2014, 08:29:23 AM »
`yes you can do that.  I think you can see examples of similar fuctions in the HotDates example with the calendar.
Basically you are going to create a NetWebForm with the source being Memory, not a table. 
1) Create 2 local variables on the page that are your start and end date. Say they are named loc:StartDate and loc:EndDate.
2) Add to the form your Browse using the Procedure control type.
3) Add a button to execute the filter and refresh the browse... on the Client-Side tab of the button, add the browse control to the reset list
4) Save that, and go to your browse
5) On the filter tab of the browse, you can add a conditional filter for being a Child of the Form you created above, and for the filter do something like this
Code: [Select]
'MyDate >= '&p_web.gsv('loc:StartDate')&' and MyDate <= '&p_web.gsv('loc:EndDate')6) Make sure to call your new memory form rather than the browse directly

Hope that helps,
Debra

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Basic Filtering
« Reply #2 on: June 12, 2014, 11:57:59 PM »
An excellent reply from Debra.

the only thing I'd add is that you can dispense with the button in step 3 if you like, and add the "browse" to the "reset list" of both date fields.

The key concept in play here is using a NetWebForm as a "container" for whatever collection of fields you want.
Plus the idea that a "browse" is just a control, and can be treated on a form as a single field.

Once you have that, and the knowledge that fields can be refreshed when other fields change, and you're pretty much all the way there.

cheers
Bruce

eas9898

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Basic Filtering
« Reply #3 on: June 13, 2014, 11:15:47 AM »
Debra, Bruce:

Thanks for the suggestions.  I'll play around with that and see where I can get.

Eddie