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

Custom DateTime Editor looses value when Cascading Listiew is selected

2 Answers 60 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
HCT-CERT
Top achievements
Rank 1
HCT-CERT asked on 17 Jan 2017, 12:44 PM

Hi,

Could you please help in solving this issue.I have 4 parameters:

-StartDate is a custom datetime picker param

-EndDate is a custom datetime picker param

-Campus is a builtin param bound to an sql datasource with both value and display text.

-Vehicle Numbers is is a builtin param bound to an sql datasource with both value and display text and mutilvalue enabled.This param is cascading from Campus param,so when picking a campus the vehicle numbers gets filtered

 

The problem I am facing is that when I pick a campus, the vehicle numbers are filtered but the start and end date values are lost.I feel the whole parameter area in being refreshed so the values entered are not restored.

.ParameterEditors(pe => pe.DateTimeEditor("createDateTimeEditor"))

 

function createDateTimeEditor(placeholder, options) {
       
        var dateTimePickerElement = $("<input type='text' style='width: 100%;' />");
        dateTimePickerElement.appendTo(placeholder);
      
        var parameter,
              valueChangedCallback = options.parameterChanged,
              dateTimePicker;
 
        function onChange() {
            var val = dateTimePicker.value();                
          
            valueChangedCallback(parameter, val);
        }
 
        return {
            beginEdit: function (param) {
 
                parameter = param;
                 
                $(dateTimePickerElement).kendoDateTimePicker({
                     
                    change: onChange
                });
 
                dateTimePicker = $(dateTimePickerElement).data("kendoDateTimePicker");
            }
        };

Environment:

-ASP.NET MVC 5

.-NET 4.5

-Latest Reporting package

 

Thanks in advance

Madani

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Stef
Telerik team
answered on 19 Jan 2017, 03:45 PM
Hello Madani,

The custom parameter editor is not configured to preserve the selected values when the cascading parameters are updating the viewer's Parameters area. Please test the custom editor settings from Report Parameter DateTime Picker Format on UI.


Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
HCT-CERT
Top achievements
Rank 1
answered on 22 Jan 2017, 09:39 AM

Thanks Stef, I kept my code as is and edited beginEdit function to get the value from the param and assign it to the widget value property:

beginEdit: function (param) {             
                parameter = param;
                var dt = null;
                try {
                    if (parameter.value) {
                        dt = parameter.value;
                    }
                } catch (e) {
                    dt = null;
                }             
                dateTimePicker = $(dateTimePickerElement).kendoDateTimePicker({
                    change: onChange
                }).data("kendoDateTimePicker");              
                dateTimePicker.value(dt);
            }
Tags
General Discussions
Asked by
HCT-CERT
Top achievements
Rank 1
Answers by
Stef
Telerik team
HCT-CERT
Top achievements
Rank 1
Share this question
or