DYNAMIC ATTRIBUTES


As we saw in previous topics, we can use attributes in UniDBGRID.


In the same way, we can "pass" through the filter function, a configuration of attributes to be used in the dynamic lookup grid.


See the edLkpUFS example:



No filter was made (but it could). We fill in a configuration so that the "description" field is displayed in UPPERCASE and with ACCENT.



SEARCH FILTERS



CODED FILTER


See, in frmCadCLIENTES, this filter in the edLkpCIDADES field:



When running the application, the CLICK event of edLkpCIDADES will be transferred to the CLICK of the button that will be created dynamically.


Let's understand what will happen:


First, it will only allow you to perform the search if a UF ( STATE ) has been selected.

Then, the search will be displayed filtering the CITIES of the selected UF and will also allow searching by the IBGE CODE and this will be returned together with the code of the selected CITY.



DYNAMIC FILTER


The example above was replaced with the use of the dynamic filter to demonstrate its use without coding anything.





The above attributes are effectively the same parameters as the dm_rc.rc_LookUpSearchFilter function.


Let's understand:


lkpfilter:quoted(uf=edLkpUFS<text>) 


Apply a filter to list cities in the lookup search by filtering by the state ("uf" ) selected in "edLkpUFS".


The "uf" information will be captured by the "<text>" property of the "edLkpUFS" field

Note: Depending on your search, you could use "<id>" to capture the primary key of "edLkpUFS".


The reserved word "quoted" applied in the sentence indicates that this content must be compared including quotation marks.

E.g.: uf = "CE"



lkpfilter-empty:Selecione uma UF<translate>


If the content of "edLkpUFS" is empty, the message "Selecione uma UF"("Select a UF") must be displayed, forcing the user to select a "uf".

The reserved word "<translate>" applied in the sentence indicates that this content can be used by "rc_Translate" to perform the translation at runtime.


lkpfilter-order: 


Apply a specific order to the list that will be displayed


lkpfilter-searchfields:codiibge 


Add the dynamic search for cities, the "codiibge" field.


lkpfilter-gridattr: 


Add dynamic attributes to the lookup search grid.





Created with the Personal Edition of HelpNDoc: Easy EPub and documentation editor