This is a migrated thread and some comments may be shown as answers.

How to retrive filtered Data From DB Server with refresh button

1 Answer 35 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Flavio
Top achievements
Rank 1
Flavio asked on 26 Nov 2015, 06:00 PM

I evaluating your component.

I need to retrive filtered data with custom filter into custom header with refresh button click

Client:

.Pageable(p => p.Refresh(true))

.Sortable()

.Selectable()

.Scrollable(scrollable => scrollable.Height(30))

.Filterable()

.HtmlAttributes(new { style = "height:550px;" })

.DataSource(dataSource => dataSource

.Ajax()

.PageSize(20)

.Model(model => model.Id(p => p.Id))

.ServerOperation(true)

.Read(create => create.Action("IncomingRead", "Grid", new { topRow = ""}))

)

Server:

public ActionResult IncomingRead([DataSourceRequest]DataSourceRequest request)

 

 

{

 

string virtualPath = "";

var customerWhereCondition = "";

var userIdWhereCondition = "";

var versionNumberWhereCondition = "";

var json = Helper.GetDataFromDb(virtualPath, 100, "-1", customerWhereCondition,

userIdWhereCondition, versionNumberWhereCondition, new DateTime(2015, 4, 1), DateTime.Now);

return Json(json.ToDataSourceResult(request));

 

 

}

 

 

how to set filter into request object(client) and get filter into the server for execute new query?

 

thankyou in advance.

Regards,

Flavio

 
 

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 30 Nov 2015, 01:34 PM
Hello Flavio,

You should use the DataSource API to get the filter expression on the server, like this:

http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#methods-filter

and after having the expression you can transform it to a custom Where condition per your needs.

Regards,
Maria Ilieva
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Flavio
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or