Hi.
I'm having a small issue with a DropDownList using server filtering. I have added a DropDownList with server filtering, and it is working as it should. My issue is that I have some checkboxes that should influence the result of the filtering. The problem is that when I have clicked the DropDownList it caches the result the next time I click it, until I type some text for the text filter.
Here is how it now works.
1) As you can see in Fig1 of the attached files, the first time I click it, it returns 1260 results
2) I then check the CheckBox "Choice1" and then click the DropDownList again, it still shows 1260 results (is supposed to be 383) and the data read method in the controller is not even triggered.
Is there some way I can get the DropDownList not to cache the results on the click, so that each time it is clicked the data read method is called?
Here's from the cshtml file:
@(Html.Kendo().DropDownListFor(m => m.Lines[i].Product.Id)
.DataTextField("Value")
.DataValueField("Id")
.OptionLabel(" ")
.AutoBind(false)
.Text(Model.Lines[i].Product.Description)
.Filter("contains")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("SearchProductLandingNote", "ReportSearchResultSurface");
})
.ServerFiltering(true);
}))
And here's from the backing controller:
public JsonResult SearchProductLandingNote(string text)
{
SurofiUser sUser = UserUtilities.GetLoggedInUser();
var products = RegisterUtilities.Instance.Products.Where(ca => ca.Description != null || ca.Code != null).ToList();
//
// Some code that filters from the checkboxes, the info from the checkboxes are stored on the User
// Checked in debugging and works fine when the method is actually called
//
return Json(products, JsonRequestBehavior.AllowGet);
}
I'm having a small issue with a DropDownList using server filtering. I have added a DropDownList with server filtering, and it is working as it should. My issue is that I have some checkboxes that should influence the result of the filtering. The problem is that when I have clicked the DropDownList it caches the result the next time I click it, until I type some text for the text filter.
Here is how it now works.
1) As you can see in Fig1 of the attached files, the first time I click it, it returns 1260 results
2) I then check the CheckBox "Choice1" and then click the DropDownList again, it still shows 1260 results (is supposed to be 383) and the data read method in the controller is not even triggered.
Is there some way I can get the DropDownList not to cache the results on the click, so that each time it is clicked the data read method is called?
Here's from the cshtml file:
@(Html.Kendo().DropDownListFor(m => m.Lines[i].Product.Id)
.DataTextField("Value")
.DataValueField("Id")
.OptionLabel(" ")
.AutoBind(false)
.Text(Model.Lines[i].Product.Description)
.Filter("contains")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("SearchProductLandingNote", "ReportSearchResultSurface");
})
.ServerFiltering(true);
}))
And here's from the backing controller:
public JsonResult SearchProductLandingNote(string text)
{
SurofiUser sUser = UserUtilities.GetLoggedInUser();
var products = RegisterUtilities.Instance.Products.Where(ca => ca.Description != null || ca.Code != null).ToList();
//
// Some code that filters from the checkboxes, the info from the checkboxes are stored on the User
// Checked in debugging and works fine when the method is actually called
//
return Json(products, JsonRequestBehavior.AllowGet);
}