- Home
- Forum
- ASP.NET Core - EJ 2
- Is UrlAdaptor supported?
Is UrlAdaptor supported?
Looking at the documentation for the querybuilder datamanager it is not clear if it works with the UrlAdapter.
Can you please clarify.
SIGN IN To post a reply.
1 Reply
SD
Saranya Dhayalan
Syncfusion Team
April 24, 2020 09:10 AM UTC
Hi David,
Thank you for contacting Syncfusion support
Queyr: Looking at the documentation for the querybuilder datamanager it is not clear if it works with the UrlAdapter.
We have checked your reported query, we would like to let you know that UrlAdaptor works in querybuilder. Please find the below code snippet:
|
<div>
<ejs-querybuilder id="querybuilder" width="100%" ruleChange="updateRule">
<e-data-manager url="Home/QBDataSource" adaptor="UrlAdaptor" crossDomain="true"></e-data-manager>
<e-querybuilder-columns>
<e-querybuilder-column field="OrderID" label="Order ID" type="number">
</e-querybuilder-column>
<e-querybuilder-column field="OrderDate" label="Order Date" type="date" format="MM/dd/yyyy"></e-querybuilder-column>
<e-querybuilder-column field="ShipCountry" label="Ship Country" type="string"></e-querybuilder-column>
</e-querybuilder-columns>
</ejs-querybuilder>
</div>
<script>
function updateRule(args) {
var qryBldrObj = document.getElementById('querybuilder').ej2_instances[0];
var predicate = qryBldrObj.getPredicate(qryBldrObj.getValidRules(qryBldrObj.rule));
var dataManagerQuery = new ej.data.Query().where(predicate);
console.log(dataManagerQuery);
}
</script> |
Homecontroller.cs
|
public IActionResult QBDatasource([FromBody]DataManagerRequest dm)
{
IEnumerable DataSource = orddata;
DataOperations operation = new DataOperations();
if (dm.Where != null && dm.Where.Count > 0) //Filtering
{
DataSource = operation.PerformFiltering(DataSource, dm.Where, dm.Where[0].Operator);
}
int count = DataSource.Cast<OrdersDetails>().Count();
if (dm.Skip != 0)
{
DataSource = operation.PerformSkip(DataSource, dm.Skip); //Paging
}
if (dm.Take != 0)
{
DataSource = operation.PerformTake(DataSource, dm.Take);
}
return dm.RequiresCounts ? Json(new { result = DataSource, count = count }) : Json(DataSource);
} |
For your convenience we have prepared a sample. Please find the below sample link
we will consider this in our online documentation site. This documentation will get refreshed in our upcoming release.
Please check and get back to us if you need further assistance on this.
Regards,
Saranya D
SIGN IN To post a reply.
- 1 Reply
- 2 Participants
-
DA David
- Apr 24, 2020 12:07 AM UTC
- Apr 24, 2020 09:10 AM UTC