Condition Builder

User166992
Tera Guru

Hi,

Is anyone used Condition Builder in UI Pages?If yes, Please share jelly code of the same

21 REPLIES 21

Hi Vprakash,



You can get the encoded query on client side by using this function getFilter('[div id that creates the condition builder]').


I am using this jelly code:



<g:ui_element table="sys_script" field="collection" id="d17a30c6ffaab100a225736c157efedf"></g:ui_element>


<g:ui_element table="sys_script" field="filter_condition" id="9d7a30c6ffaab100a225736c157efee3"></g:ui_element>



So, the function to get the query for this example will be:



alert(getFilter('element.sys_script.filter_condition'));




Screen Shot 2015-06-22 at 09.54.33.png




I hope that helps.


Do you know of a way to set the filter?



I've tried:


        setFilter('element.sys_script.filter_condition', 'savedfiltervalues')



But this unfortunately does not work. The purpose of setting it would be when the UI Page loads, the condition builder is set with the user's previously saved conditions (but can be changed if needed).


hartr
Giga Contributor

Did you find a way to set the filter on the UI page from an encoded string (I am trying to do the same thing) ?



Thanks


Hi Rafael,



  1. <g:ui_element table="sys_script" field="collection" id="d17a30c6ffaab100a225736c157efedf"></g:ui_element>  
  2. <g:ui_element table="sys_script" field="filter_condition" id="9d7a30c6ffaab100a225736c157efee3"></g:ui_element>


What do the above LOC mean?



We have a custom table and I am trying to build a report module for this specific table. So I need to add filter conditions like And and OR (Whatever we have on report module) I am trying to understand how to approach the design and I stumbled across this post.


 


Hi 

using below line I am able to get the value for the condition builder.

alert(getFilter('element.sys_script.filter_condition'));

 

How can I get the value of the table?. I am looking for similar functionality of list filter I mean after setting the filter condition (say on incident- active=true) when we click on Run, as a result we will get active incidents. 

 

Please suggest how can get it.

 

Thanks and Regards,

Pradeep D J