7 Answers, 1 is accepted
0
Accepted
Hello Scott,
Check the "serverfiltering.cshtml" demo.
Regards,
Georgi Krustev
the Telerik team
Currently, the DataSource builder used by the AutoComplete does not provide the ability to override the parameterMap. Nevertheless, you can send additional parameters to the server using Data method of the DataSource builder:
...
.DataSource(source => {
source.Read(read =>
{
read.Action(
"GetProducts"
,
"Home"
)
.Data(
"onAdditionalData"
);
})
)
<
script
>
function onAdditionalData() {
return {
filterText: $("#products").val()
};
}
</
script
>
Regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Guilherme
Top achievements
Rank 1
answered on 22 Feb 2013, 05:52 PM
Hello
I tried to use the default parameterMap, but doesn't work for me.
Doesn't matter what I do, I'll never receive the parameter which represents the input data from user.
The only way which I found is overriding the paramerterMap as you said.
My question is: how can I use the default parameterMap without using ServerFiltering(true)?
Thanks!
I tried to use the default parameterMap, but doesn't work for me.
@(Html.Kendo().AutoComplete()
.Name(
"PartSearchCriteria"
)
.DataSource(dataSource => dataSource
.Read(conf => conf.Action(
"FindPart_SelectPart"
,
"Order"
).Type(HttpVerbs.Post)
.Data(
"editOrderView.PartSearchCriteria_Data"
))
.ServerFiltering(
false
)
)
.Filter(FilterType.Contains)
.HighlightFirst(
true
)
.Suggest(
true
)
.HtmlAttributes(
new
{ title = UI_Resources.FindParts_PartSearchCriteriaTooltip, style =
"width:300px;"
})
)
The only way which I found is overriding the paramerterMap as you said.
My question is: how can I use the default parameterMap without using ServerFiltering(true)?
Thanks!
0
Hello ,
Georgi Krustev
the Telerik team
The Data callback should sufficient to sent any additional parameters to the server. Could you share with us what is the PartSearchCriteria_Data implementation? Any runnable test project, which replicates the problem will be of a great help.
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Guilherme
Top achievements
Rank 1
answered on 26 Feb 2013, 10:53 PM
Hello Again
The point is: I dont wanna any additional parameters, I just want the default one (input from user).
AutoComplete:
PartSearchCriteria_Data:
Controller:
The only way that I manage to receive the "string text" parameter is using .Data("editOrderView.PartSearchCriteria_Data")
I checked the HTTP POST with Bugzilla and for sure no http parameter are passing to server.
Do exist a way to receive the default parameter in the server without using this custom event?
Thanks!
The point is: I dont wanna any additional parameters, I just want the default one (input from user).
AutoComplete:
@(Html.Kendo().AutoComplete()
.Name("PartSearchCriteria")
.DataSource(dataSource => dataSource
.Read(conf => conf.Action("FindPart_SelectPart", "Order").Type(HttpVerbs.Post)
.Data("editOrderView.PartSearchCriteria_Data")
)
.ServerFiltering(false)
)
.Filter(FilterType.Contains)
.HighlightFirst(true)
.Suggest(true)
.HtmlAttributes(new { title = UI_Resources.FindParts_PartSearchCriteriaTooltip, style = "width:300px;"})
)
PartSearchCriteria_Data:
function
(e) {
return
{
text: $(
"#PartSearchCriteria"
).val()
};
},
[HttpPost]
public
ActionResult FindPart_SelectPart(
string
text)
{ ... }
The only way that I manage to receive the "string text" parameter is using .Data("editOrderView.PartSearchCriteria_Data")
I checked the HTTP POST with Bugzilla and for sure no http parameter are passing to server.
Do exist a way to receive the default parameter in the server without using this custom event?
Thanks!
0
Hello Guilherme,
Please note that index can be different.
Other option is to parse filter options manually. Check this demo, which shows how to achieve this.
Regards,
Georgi Krustev
the Telerik team
In that case you can get the filter value in the Action method like this:
Request.QueryString["filter[filters][0][value]"]
Other option is to parse filter options manually. Check this demo, which shows how to achieve this.
Regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Guilherme
Top achievements
Rank 1
answered on 01 Mar 2013, 02:43 PM
Hey!!!
You solution only works with:
But I'd like to filter in client side.
Do we have any other option?
Regards
You solution only works with:
.ServerFiltering(true)
Do we have any other option?
Regards
0
Hello Guilherme,
Georgi Krustev
the Telerik team
Sorry, I missed the .ServerFiltering(false) in your configuration. Unfortunately in that case you will need to use Data callback.
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!