Use dropdownlist filter as a customised filter

Discuss about features you want to see in the next versions of ApPHP DataGrid. Your requests and offers.

Moderators: ne_moj, zewa

Sardius
Master
Master
Posts: 135
Joined: Jul 3rd, '10, 18:45

Use dropdownlist filter as a customised filter

Postby Sardius » Jun 21st, '12, 06:15

Could you add a switch to the Filter definition where the view_type is dropdownlist. The switch will disable or enable the use of the filter in the final SQL query for returning data to the datagrid.
It seems that to achieve what I am requesting, you must create a customised filter and then do a sql query as indicated in the following link...
viewtopic.php?f=33&t=184

If you made an option on the dropdownlist filter definition to not include the selection in the SQL which creates the final datagrid, one could us a table as s custom filter without having to do the sql coding as an additional step.

administrator
Site Admin
Site Admin
Posts: 5939
Joined: Jan 7th, '09, 23:18
Contact:

Re: Use dropdownlist filter as a customised filter

Postby administrator » Jun 21st, '12, 20:17

What do you mean disable? Like active/inactive? you may easy add such attribute for this field and customize the code to use it.

Sardius
Master
Master
Posts: 135
Joined: Jul 3rd, '10, 18:45

Re: Use dropdownlist filter as a customised filter

Postby Sardius » Jun 22nd, '12, 05:06

When you use a filter where the view_type is dropdownlist it will append the filter criteria to the WHERE clause of the main sql query. If you could have an option to use it as a separate query it could be useful in dependent drop down lists for example.

administrator
Site Admin
Site Admin
Posts: 5939
Joined: Jan 7th, '09, 23:18
Contact:

Re: Use dropdownlist filter as a customised filter

Postby administrator » Jun 24th, '12, 07:25

You have a 'filter_condition'=>'', attribute for filtering fields.
Did you try it?

Sardius
Master
Master
Posts: 135
Joined: Jul 3rd, '10, 18:45

Re: Use dropdownlist filter as a customised filter

Postby Sardius » Jul 4th, '12, 17:25

No. Using a 'filter_condition'=>'' is not what I am trying to achieve. I do not want the filter to be used in the main query. I just want it for the ease of populating a dropdown box.

In HOW TO make customized filtering, the customised filtering is based on a textbox field. I am wanting the same thing but where 'type'=>'enum'

This would negate the need to do an executesql and loop through the results etc etc...

Lets say you want to list all employees who are in a specific company. You want to select a company in a dropdown list and then you want a second dropdown list to show the employees relating to the selected company. I do not want the company to be part of the WHERE clause. Only the selected employee must be included in the WHERE clause.

administrator
Site Admin
Site Admin
Posts: 5939
Joined: Jan 7th, '09, 23:18
Contact:

Re: Use dropdownlist filter as a customised filter

Postby administrator » Jul 5th, '12, 08:00

In case case you must create pre-defined array of values and use it as a source for your "enum" type.
Currently there is no another way to do it.

jacky374
Newbie
Newbie
Posts: 1
Joined: Nov 1st, '13, 10:55

Re: Use dropdownlist filter as a customised filter

Postby jacky374 » Nov 1st, '13, 11:19

If you could have an option to use it as a separate query it could be useful in dependent drop down lists for example. What do you mean disable? Like active/inactive?


Return to “ApPHP DataGrid {future features}”