How to localize boolean values in query builder?

How to localize true and false values. I've tried 'True' and 'False' but this don't work.


3 Replies 1 reply marked as answer

SP Sangeetha Priya Murugan Syncfusion Team October 7, 2020 09:52 AM UTC

Hi Sergey, 
 
Thank you for contacting Syncfusion support. 
 
We have checked your reported requirement and we would like to let you know that your requirement can be achievable in our QueryBuilder by using Value property as like in the below code example. 
 
CODE SNIPPETS: 
 
QueryBuilderRule rule = new QueryBuilderRule() 
            { 
                Condition = "and", 
                Rules = new List<QueryBuilderRule>() 
                { 
                    new QueryBuilderRule { Label="Title Of Courtesy", Field="TitleOfCourtesy", Type="boolean", Operator="equal", Value = "True" }, 
                    new QueryBuilderRule { Label="Title", Field="Title", Type="string", Operator="equal", Value = "Sales Manager" } 
                } 
            }; 
 
            List<string> values = new List<string> { "True", "False" }; 
 
            ViewBag.rule = rule; 
            ViewBag.values = values; 
            ViewBag.dataSource = EmployeeView.GetAllRecords(); 
            return View(); 
 
<ejs-querybuilder id="querybuilder" width="73%" rule="ViewBag.rule" dataSource="ViewBag.dataSource" maxGroupCount=5 created="createdControl"> 
    <e-querybuilder-columns> 
        <e-querybuilder-column field="TitleOfCourtesy" label="Title Of Courtesy" type="boolean" values="ViewBag.values"></e-querybuilder-column> 
    </e-querybuilder-columns> 
</ejs-querybuilder> 
 
For your convenience, we have prepared the sample based on our suggestion. Please find the link below. 
 
 
Could you please check the above sample and get back to us, if you need any further assistance on this. 
 
Regards, 
Sangeetha M 



Marked as answer

SE Sergey October 7, 2020 02:51 PM UTC

Hi Sangeetha,

This approach change value type from "bool" to "string", changing only labels would be more convenient.  When using integration with Data Grid and datamanager need some additional code to convert values on server side.

Adding the ability to localize like other properties would be the preferred solution. 

https://ej2.syncfusion.com/aspnetcore/documentation/query-builder/global-local/



SP Sangeetha Priya Murugan Syncfusion Team October 8, 2020 12:13 PM UTC

Hi Sergey, 
 
Thank you for your update. 
 
We have checked your reported requirement and currently we don’t have this support. However, we will consider this and the fix for this issue will be available in our Essential Studio Volume 3 SP1 release. Which is scheduled to be rolled out in end of this month. We appreciate your patience until then. 
 
Regards. 
Sangeetha M 



Loader.
Up arrow icon