Overview
XMod Pro is awesome! Unfortunately, I have not found an easy way to filter out the results of the list form. The new, proposed filter section could contain text boxes or/and drop down boxes that would allow users to filter down the results of the list.
Benefits
Adding this functionality would allow XMod Pro to be used to create more complex solutions easily.
Possible implementation
I'm not an expert in XMod Pro. So please excuse me if things don't make sense.
The solution could be related to modifying the commandText used in ListDataSource. The XMod Pro configuration screens could have the following new sections:
1. Ability to turn on the filtering. The form configuration screen should have the option to include the filtering section on the List view form. At the same time, it should allow the user to position the filtering section on the left, upper, right side of the list grid.
2. Configuring ListDataSource SQL query. Since all the filtering values will be used in commandText of the ListDataSouce, it's necessary to allow the user to modify the underlying SQL query. Provide a text box with the exposed custom, SQL statement:
For example:
"SELECT [id],[Question],[Answer], [Category] FROM FAQ WHERE [[ques_column]][[ques_operator]][[ques_value]]] AND [[cat_column]][[cat_operator]][[cat_value]]]";
3. Configure each filtering items. Each item should have the following settings:
a) Table column - this is the column name used in filtering. Allowing to configure this value is critical, because users might want to use joins in their sql statement. One of the filtering column might end up looking like this "m.question".
b) Operator - like, =, >, < etc.
b) value prefix - *, '
c) value post fix - ' - (this is useful if value is a string)
d) Display type: text box, drop down
e) If the drop down is selected then allow to specify the display items and values to be used for the SQL query in each value.
4. Gluing it all together. The trick is to modify the commandText during the runtime, so it reflects the values selected by the user. So, if the user used both question and category filtering column, the SQL would look like this:
"SELECT [id],[Question],[Answer], [Category] FROM FAQ WHERE [[ques_column]][[ques_operator]][[ques_value]]] AND [[cat_column]][[cat_operator]][[cat_value]]]";
If only category then like this:
"SELECT [id],[Question],[Answer], [Category] FROM FAQ WHERE [[cat_column]][[cat_operator]][[cat_value]]]";
Just omit fields that are not used.
If user didn't select any columns for filtering, then just use this one:
"SELECT [id],[Question],[Answer], [Category] FROM FAQ"
This is just an idea, which has limitations and is far away to be completed. But having at least this functionality in place would be useful for the stuff that I'm trying to do. I hope that others find it useful as well.
If you know an easy way to filter down the list without building an extra store procedure, please let me know.
Have a nice build day!