This is a migrated thread and some comments may be shown as answers.

Grid filtering functionality to be readonly

8 Answers 299 Views
Grid
This is a migrated thread and some comments may be shown as answers.
zhivko.zhelezov
Top achievements
Rank 1
zhivko.zhelezov asked on 18 Jun 2016, 10:45 AM

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

Sort by
0
zhivko.zhelezov
Top achievements
Rank 1
answered on 18 Jun 2016, 10:51 AM

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 :)

 

 

0
Daniel
Telerik team
answered on 22 Jun 2016, 05:49 AM
Hello,

There isn't a built-in option but this can be implemented by using the filterMenuInit event - example.

Regards,
Daniel
Telerik
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
zhivko.zhelezov
Top achievements
Rank 1
answered on 22 Jun 2016, 08:30 AM

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

0
Daniel
Telerik team
answered on 24 Jun 2016, 05:36 AM
Hi again,

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
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
zhivko.zhelezov
Top achievements
Rank 1
answered on 24 Jun 2016, 12:00 PM

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!

0
Daniel
Telerik team
answered on 28 Jun 2016, 08:30 AM
Hi,

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
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
zhivko.zhelezov
Top achievements
Rank 1
answered on 29 Jun 2016, 06:47 AM

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

0
Daniel
Telerik team
answered on 01 Jul 2016, 06:41 AM
Hi,

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
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
Tags
Grid
Asked by
zhivko.zhelezov
Top achievements
Rank 1
Answers by
zhivko.zhelezov
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or