cancel
Showing results for 
Search instead for 
Did you mean: 

sap.m.DatePicker issue

Former Member
0 Kudos

Does anyone know how to make the SAPUI5 control sap.m.DatePicker read only? I would like to be able to show the standard calendar UI to the user if he clicks on the little calendar icon but the user shouldn't be allowed to actually change the date. I am try js view for designing.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member227918
Active Contributor
0 Kudos

I think below work around would work, perform below 2 tasks,

1) disable pointer focus in input using below css code,

.sapMInputDivWrapper {
    pointer-events: none;
}

2) you must have previous date value somewhere in the model property or a variable, keep this, and implement 'change' event of datepicker and return/set previous value only instead of changed value.

hope this works!