6 Answers, 1 is accepted
0
Hi Ryan,
With the current implementation, you should bind to the filterMenuInit event of the Grid and trigger the change event of the custom DropDownList.
E.g.
Regards,
Dimiter Madjarov
Telerik
With the current implementation, you should bind to the filterMenuInit event of the Grid and trigger the change event of the custom DropDownList.
E.g.
filterMenuInit:
function
(e){
if
(e.field ===
"City"
){
e.container.find(
"input"
).data(
"kendoDropDownList"
).trigger(
"change"
);
}
}
Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Ryan
Top achievements
Rank 1
answered on 25 Mar 2014, 03:46 PM
I don't think that would work. I wouldn't want to filter on filterMenuInit, I would want to filter only if the user clicks the Filter button.
1. Custom filter menu is applied
2. Grid is created
3. User opens custom filter menu which shows "City" instead of "Select one" in order to allow filtering of first valid value without requiring clicks.
4. Only if user clicks Filter do I apply the filter using the city, e.g. Seattle.
Does that make sense?
1. Custom filter menu is applied
2. Grid is created
3. User opens custom filter menu which shows "City" instead of "Select one" in order to allow filtering of first valid value without requiring clicks.
4. Only if user clicks Filter do I apply the filter using the city, e.g. Seattle.
Does that make sense?
0
Hello,
Have you tried the suggested approach on your side, as I think that it covers the current requirements? Here is the updated example.
Regards,
Dimiter Madjarov
Telerik
Have you tried the suggested approach on your side, as I think that it covers the current requirements? Here is the updated example.
Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Ryan
Top achievements
Rank 1
answered on 25 Mar 2014, 05:05 PM
It works for the first filter click. After clicking clear and then filter it fails once again.
0
Accepted
Hi Ryan,
Indeed your observation is correct. The workaround for this issue consist of two parts - first we should bind to the open event of the filter menu popup, so that the custom logic is executed each time the menu is opened, not just the first one. Then we should explicitly set the value of the dropdownlist element, which was cleared.
E.g.
Here is the updated version of the example.
Regards,
Dimiter Madjarov
Telerik
Indeed your observation is correct. The workaround for this issue consist of two parts - first we should bind to the open event of the filter menu popup, so that the custom logic is executed each time the menu is opened, not just the first one. Then we should explicitly set the value of the dropdownlist element, which was cleared.
E.g.
filterMenuInit:
function
(e){
if
(e.field ===
"City"
){
e.container.data(
"kendoPopup"
).bind(
"open"
,
function
() {
var
ddl = e.container.find(
"input"
).data(
"kendoDropDownList"
);
ddl.element.val(ddl.dataItem());
ddl.trigger(
"change"
);
});
}
}
Here is the updated version of the example.
Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Ryan
Top achievements
Rank 1
answered on 26 Mar 2014, 02:27 PM
Hi Dimiter,
Interesting use of the undocumented kendoPopup base widget. The workaround works as expected. Thank you
Interesting use of the undocumented kendoPopup base widget. The workaround works as expected. Thank you