how to clear the condition filter when main filter is empty in aggrid - angular8

I am using an ag-grid and i have enabled filtering, now i when type something in the filter textbox then the conditional filter is automatically shown.
My requirement is to clear the conditional filter text box when main filter textbox is cleared.
Below is the code i tried but i dont know how to check if the textbox is empty or not and how to clear the conditional textbox when the main textbox is cleared.
onFilterChanged: function(filterParams) {console.info('alert');},

You need to listen to events on your textbox and as soon as it is cleared, you call the grid api
gridOptions.api.setFilterModel(null);

Related

Control Source of a text boxes set to DCount function - Refresh issue

I'm setting the control source of text fields to return the value of a function (multiple fields with different filtering conditions). The form has a combo box with a list of years: when the user selects a specific year, the on change event triggers a refresh of all the fields.
My problem is the fields don't show any values unless after combo box's On Change events. I have to click on the form/fields before the values start showing up.
I tried to do form refresh & field's requery but doesn't work.
The text field's Control Source is set to:
=SummaryReport("Projects","G","1",[Forms]![frmSUMMARY_REPORT]![cmbYEARS])
What I'm trying to do is when the user selects a year from a drop down, the fields values are updated & displayed by the On Change event - currently they seem to be updated but are not showing unless I click on the screen and that's when values start showing up in each field.
The method to update calculated fields is Me.Recalc (or myForm.Recalc):
https://learn.microsoft.com/en-us/office/vba/api/access.form.recalc
Try this instead of .Refresh.
Also I think the better event to use is After Update instead of On Change for a combo box.

Binding options dropdown filtering with textbox value in Google App Maker

Good day to all,
I need your help to binding an dropdown in Google App Maker.
I have 2 datasources, one for value and other for options and names. The problem is when I try to filter the dropbox with a textbox value.
in TextBox's onValueChange I put this code but it does not work.
var item = widget.parent.descendants;
app.datasources.Prycts_Cmpns.query.clearFilters();
app.models.FCTRSRCBDS.datasources.Prycts_Cmpns.query.filters.s_AliasCompany._contains=widget.value;
app.models.FCTRSRCBDS.datasources.Prycts_Cmpns.load();
the next code is the datasources options,value and names of the dropdown:
How i can filter this dropdown with the filter?
Thxs
I have a feeling, that
User enters some filter in TextBox
In onValueChange you call clearFilters what wipes user's input
You load Prycts_Cmpns datasource with no filters
So to fix this you can check that the TextBox is bound to app.models.FCTRSRCBDS.datasources.Prycts_Cmpns.query.filters.s_AliasCompany._contains and simplify onValueChnage event handler to this
// at this point filter's value should be already set by binding
app.models.FCTRSRCBDS.datasources.Prycts_Cmpns.load();

gridEX checkbox filter shows text value when not selected

I am filtering a checkbox column with FilterEditType.CheckBox. Whenever I click on the filter it works fine, but when the filter column loses focus it shows the textual representation of the checkbox. In my case right now it is a 1 or a 0 and I know I can use CheckBoxTrueValue or CheckBoxFalseValue to change it to something else.
I need the filter to either show a checkbox(checked or not checked) or nothing at all while it has the filter applied. Does anyone know how to do this I couldn't find a property that seemed to fit.

Gray out a form row's (detail's) button conditionally with VBA code

I have a standard form in MS-Access which lists a bunch of orders, and each row contains order no, customer, etc fields + a button to view notes and attached document files.
On request from our customer we should gray out the button btnAnm (or check or uncheck a checkbox) depending on a calculation from two queries to two other tables (a SELECT COUNT WHERE and a check if a text field is empty).
I've tried btnAnm_BeforeUpdate(...) and btnAnm_BeforeRender(...) and put breakpoints in the subs, but none of them trigger. The same if I use the control Ordernr instead of btnAnm.
I'd like a function in the Detail VBA code to be triggered for each "Me." (row) so to speak, and set the row's control's properties in that sub.
What do I do? I've looked at the help file and searched here.
*Edit: So I want to do something that "isn't made to work that way"? Ie. events are not triggered in Details.
As an alternative, could I base the value of a checkbox on each line on a query based on the 'Ordernr' field of the current row and the result of a SELECT COUNT from another table and empty field check?
Do I do this in the query the list is based on, or can I bind the extra checkbox field to a query?
A description of how to do this (combine a COUNT and a WHERE "not empty" to yes/no checkbox value) would be perfectly acceptable, I think! :)*
You cannot do much with an unbound control in a continuous form, anything you do will only apply to the current record. You can use a bound control with a click event so that it acts like a button.
Presumably the related documents have a reference to the order number that appears on your form, which means that you can create a control, let us call it CountOrders, with a ControlSource like so:
=DCount("OrderID","QueryName","OrderID=" & [OrderID])
The control can be hidden, or you can set it up to return true or False for use with a textbox, you can also use it for Conditional Formatting, but sadly, not for command buttons.
Expression Is [CountOrders]>0
You can also hide the contents and add a click event so that is acts in place of the command button. Conditional Formatting will allow you to enable or disable a textbox.
As I understand your question, you have a continuous form with as command button that appears on each row - and you'd like to enable/disable the button conditionally depending on the contents of the row.
Unfortunately you can't do that. It seems that you can't reference the individual command buttons separately.
Having wanted to do something similar in the past I came up with two alternate ways of setting up my interface.
Put a trap into the onClick code for the Button. Which is icky, because it is counter intuitive to the user. But it gets you that functionality now.
Move the command button (and editable fields) up into the form header, and make the rows read only. Your users then interact with the record only in the header, and select the record they want work with in the list below. As I recall this is known a Master-Detail interface.

How to make custom Combo box control which have contain datagrid in vb.net

I want to make custom combo box which have contain datagrid and textbox too.
On clicks into combo box datagridview should be appear and selecting any row particular cell value of the datagridview added on the combo.
thanks in advance..
As your question is written I have no idea how to answer it, I can't figure out how you could sensibly show a DataGridView inside a ComboBox. I'm writing this answer with the assumption that you mean that the form should have a ComboBox that are "linked" to a DataGridView rather than actually contain it.
If so, all you need to do is to add the ComboBox and DataGridView to the form, make the DataGridView invisible. Then you handle the SelectedIndexChanged event for the ComboBox, in the handler, make the grid visibile, find the index of the row and column you want to show and write code like (code not tested so might not be correct):
grid.SelectedRows.Clear()
grid.FirstDisplayedScrollingRowIndex = rowIndex
grid.Rows(rowIndex).Cells(colIndex).Selected = True
grid.Show()