Hello,
I would like to ask if there is a possibility the filtering which is enabled from datasource (filterable: true) to be active and visible but readonly.
Actually we have a scenario in which in 'Edit mode' the user can choose by which columns the grid to be filtered, and then when saved and ran in 'Live mode' the grid is reloaded and the user could only see by which columns the grid data is filtered but cannot change the filter.
Thank you,
Regards
8 Answers, 1 is accepted
Remark... I mean the filter menu to be readonly which is enabled through Grid options by column (field: "someField", filterable:true) here is the documentation of this property :)
There isn't a built-in option but this can be implemented by using the filterMenuInit event - example.
Regards,
Daniel
Telerik
Hello Daniel,
thanks for the answer.
Actually I have a problem implementing your code. The method kendo.widgetInstance($(this)); needs one more parameter so i gave to it kendo.ui, but still there is no method widget.readonly(true);
I tried to do the following:
var widgets = e.container.find(":input");
var i = 0,
len = widgets.length;
for (var i = 0; i < len; i += 1) {
widgets[i].setAttribute("readonly", true);
}
This sets the attribute to true but still all inputs are actually not readonly. Do you have some suggestions?
Regards
Is there anything specific about your scenario. The example that I linked in my previous reply seems to work correctly. Also, all the basic input widgets(dropdownlist, numerictextbox, datepicker, etc.) should have a readonly method.
Regards,
Daniel
Telerik
Hello,
Maybe the specific about our scenario is that we are using TypeScript and into the base class kendo.ui.Widget there is no method readonly() as in derived kendo.ui.DropDownList.
Any other try to set a readonly attribute actually sets the attribute but the result is that the input is not readonly.
Thanks and Regards!
Setting the attribute will not work because the widgets are already initialized. You could cast kendo.ui.Widget to a type that supports the readonly method in order to be able to use.
Regards,
Daniel
Telerik
Hello Daniel,
I tried to cast and it is ok but in your Dojo example above the filtering is not readonly for column 'Doscontinued'. How could I make it works for columns of this type where I have checkboxes or radiobuttons.
Regards
The approach will not work for radio buttons and checkboxes because they cannot be readonly. You can make them disabled instead of readonly in order to not allow input.
Regards,
Daniel
Telerik