Skip to main content

Hi 

    I have 3 drop down list controls.  When i click on these drop down values i need to filter only those values  and display in editable list view? 

How do i do this?

on drop down change event i need to filter those values selected 

Thanks in advance

Hi Nain


 


The route the needs to be followed to achieve this behaviour would depend on how and when the filter needs to be applied... Does the filter need to be applied to the Editable List View when all 3 the Drop Down List have changed OR only when one of them had changed. Depending on the above requirement please see the below Solutions.


 


Solutions 1 - Apply the filter to the Editable List View when all 3 Drop Down Lists has changed.


Description:


Using a unbound rule you can filter the data in the editable list based on all the selections made in all three of the drop downl list. The unbound rule can then be called on each of the drop down lists change events, this will result in the view being filtered based on the first selection made in the first drop down and then when the second drop down is change the filter will execute again but without losing the filtering selected in the first drop down, instead the view will then filter based on the selections made in both the first and the second drop down list (the same applies to drop down three as well.


 


Steps:


1) Create a SmaortObject, add three different properties "I Used Name(Text), Surname(Text) and Age(Number)".


 


SmartObject.png


 


2) Create a Editable List View from the smartObject and ensure that this SmartObejct is the Editable lists Data Source.


 


EditableListDataSource.png


 


3) Edit the Editable List and add three Drop Down List Controls.


4) Navigate to the Rule Breadcrumb tab and add a new rule (Do not provide the rule with and Event, instead just rename the rule). This will create a unbound rule which can be recalled in other rules. Configure the Unboudn rule further to resemble the below image.


 



13907i15D5A5F510656798.png



 


5) On each of the drop down lists Change Event you would need to call the unbound rule, to do this locate the rule called "Execute another Rule" which can be found at the bottom of the Actions tab.


 


CallingUnboundRule.png



 


6) Save Finish and Run the view.


 


*I have tested this where the bahaviour was satisfactory as the filters had been applied based on my selections made in each of the dropdowns without losing any of the filtering made in the previous drop down selections.


12672iAAD5AC908383FC7D.png


 


Solutions 2 - Apply the filter to the Editable List View when a single Drop Down Lists has changed.


Description:


Configuring your filter based on when one of the drop down list had changed will result in the filter being applied to to editable list view everytime one of the drop down lists have changed meanign that if you select a value in the first dorp down the filter will execute and filter based on tha value however if you then select a value in the second drop down the filtering for the first drop down selection will be lost and the editable list will then filter based on the second drop downs selection.


 


Steps:


1) Create a SmaortObject, add three different properties "I Used Name(Text), Surname(Text) and Age(Number)".


SmartObject.png


2) Create a Editable List View from the smartObject and ensure that this SmartObejct is the Editable lists Data Source.


EditableListDataSource.png


3) Edit the Editable List and add three Drop Down List Controls.


4) On each drop down lists Change Event execute the Editable List views GetList method using the rule called "Execute a method on the view" and configure each to filter based on the values the drop down list contains, Example: Filter Name Drop Down with the name value from the SmartObject connected to the Drop Down list.


 


Note: Should you feel that this post is of use and or an accurate solution to the raised question, I kindly encourage you to mark it as such using the 'Mark as Solution', 'Kudo' andor ‘Me Too’ options.


 


Kind Regards


Raymond


Good Day @Nain


 


I created some KB articles regarding this issue and the solutions, should someone else run into the same issue they would have exact steps to follow in order to get the underlining issue resolved.


 


The KB Articles can be accessed from here:


How to apply filtering to Editable List View on Multiple drop-down list changes


https://help.k2.com/products/kbs100109?lang=en


 


How to apply filtering to Editable List View when a Single drop-down list changes


https://help.k2.com/products/kbs100110?lang=en


 


Note: Should you feel that this post is of use and or an accurate solution to the raised question, I kindly encourage you to mark it as such using the 'Mark as Solution', 'Kudo' andor ‘Me Too’ options.


 


Kind Regards


Raymond


Reply