styling dropdownlist from querybuilder

Hi,

I have two questions which blocked me with my work.

1. How we can can remove the scrollbar for fields dropdown in querybuilder 
2. Is there any property where we can limit number of conditions in querybuilder(I know we have maxgroupCount property which restrict the user to no. of groups but I want to restrict no.of conditions ).

Any help would be appreciated.

Thank you.

3 Replies

SD Saranya Dhayalan Syncfusion Team February 13, 2020 10:08 AM UTC

Hi MaazMohammed 
 
Thank you for contacting Syncfusion support 
 
Query – 1: How we can can remove the scrollbar for fields dropdown in querybuilder  
 
 
We have checked your reported query and we can achieve this by setting the dropdownlist popupHeight as auto in created event. Please find the below code snippet:  
 
    function createdControl(): void { 
        bindEvent(); 
        if (Browser.isDevice) { 
           qryBldrObj.summaryView = true; 
        } 
    } 
 
   function bindEvent(): void { 
            let ddlColl: HTMLElement[] = document.querySelectorAll('.e-rule-filter .e-dropdownlist'); 
            for (let i: number = 0; i < ddlColl.length; i++) { 
                let ddl: DropDownList = getComponent(ddlColl[i], "dropdownlist"); 
                ddl.popupHeight = "auto"; 
 
            } 
        } 
 
 
 
Query-2: Is there any property where we can limit number of conditions in querybuilder(I know we have maxgroupCount property which restrict the user to no. of groups but I want to restrict no.of conditions ). 
 
We have checked your reported scenario and we can achieve this by setting the args.cancel property as true in beforeChange event.  
 
  function onBeforeChange(args: any): void { 
            if (args.type == "insertRule") { 
                if (qryBldrObj.getGroup(args.groupID).rules.length > 1) { 
                    args.cancel = true; 
                } 
            } 
        } 
 
For your convenience we have prepared a sample. Please find the below sample link 
 
 
Could you please check the above sample and get back to us if you need further assistance on this? 
 
Regards, 
Saranya D 



MA MaazMohammed February 13, 2020 04:44 PM UTC

Thank you, your solution has solved my problem.


SD Saranya Dhayalan Syncfusion Team February 13, 2020 04:57 PM UTC

Hi MaazMohammed, 
 
Most Welcome… 
 
We are happy to hear that your issue has been resolved. Kindly get back to us if you need any further assistance. 
 
Regards, 
Saranya D 


Loader.
Up arrow icon