Hi,
This post is about a new incidence with Internet Explorer 11 and dropdownlist. The first time I click over dropdownlist the list of values are loading, but the list is closed. I should click again to get the list without close the list.
Editor Template
Method from editor template
Grid with column ContactID and mode Popup
View Model
Can you say anything about this behavior?
Thanks.
Xavier.
This post is about a new incidence with Internet Explorer 11 and dropdownlist. The first time I click over dropdownlist the list of values are loading, but the list is closed. I should click again to get the list without close the list.
Editor Template
@model
object
@(Html.Kendo().DropDownList()
.HtmlAttributes(
new
{ style =
"width: 450px;"
})
.Name(
"ContactID"
)
.DataTextField(
"Text"
)
.DataValueField(
"Value"
)
.Filter(FilterType.Contains)
.OptionLabel(
"-please select-"
)
.ValuePrimitive(
true
)
.AutoBind(
false
)
.DataSource(source =>
{
source.Read(read =>
{
read.Action(
"MultiSearchProductors"
,
"Productors"
,
new
{ area =
"Comercial"
}).Data(
"filterSearchProductor"
);
})
.ServerFiltering(
true
);
})
)
Method from editor template
public
async Task<JsonResult> MultiSearchProductors(
string
text)
{
var user = await UserManager.FindByIdAsync(User.Identity.GetUserId());
var productors = ens.Contacts.OfType<Productor>().Where(p => user.AuthorizedCenters.Contains(p.CentreID.ToString()) && p.Baixa ==
null
).Select(p =>
new
{
Value = p.ContactID,
Text = p.Nom +
" "
+ p.Addresses.FirstOrDefault(a => a.TypeID == (
short
)addressType.General).Poblacio.Denominacio +
" - "
+ p.ContactID
});
if
(!String.IsNullOrWhiteSpace(text))
{
productors = productors.Where(p => p.Text.Contains(text));
}
return
Json(productors, JsonRequestBehavior.AllowGet);
}
function filterSearchProductor() {
return
{
text: $(
"#ContactID"
).data(
"kendoDropDownList"
).filterInput.val()
//allCenters: true
};
}
Grid with column ContactID and mode Popup
@(Html.Kendo().Grid<PartnerViewModel>()
.Name(
"partner_"
+contactID)
.ToolBar(t =>
{
if
(User.IsInRole(
"Modify"
))
{
t.Create().Text(
"Nou Partner"
);
}
})
.Columns(columns =>
{
columns.Bound(f => f.ContactID).Title(
"Codi"
).Width(60);
View Model
public
class
PartnerViewModel
{
[DisplayName(
"Productor"
)]
[UIHint(
"ProductorMultiSearch"
)]
public
int
ContactID {
get
;
set
; }
Can you say anything about this behavior?
Thanks.
Xavier.