Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calendar disabled or readonly not working #125

Closed
fairking opened this issue Dec 28, 2019 · 6 comments
Closed

Calendar disabled or readonly not working #125

fairking opened this issue Dec 28, 2019 · 6 comments

Comments

@fairking
Copy link

fairking commented Dec 28, 2019

Is there any disabling or readonly ability for the calendar?
I tried to apply both of the attributes but it is not working.

<DatePicker id="from_date" v-model="item.fromDate" :showTime="!item.allDay" 
:disabled="item.isPublished" :readonly="item.isPublished" />
@fairking

This comment has been minimized.

@cagataycivici
Copy link
Member

<Calendar v-model="date1" :disabled="true" />

disabled worked for me, the input is greyed out, what is your version?

@fairking
Copy link
Author

"primevue": "1.0.0-rc.1",

@fairking
Copy link
Author

fairking commented Dec 28, 2019

It is working. The attribute values were not passed down to the Calendar control.
Apologizes.

@fairking
Copy link
Author

The only issue is readonly which allows to edit value in the input field.

@fairking
Copy link
Author

This is my component DatePicker.vue:

<template>
	<Calendar :value="value" @select="dateSelect" date-format="dd.mm.yy" :show-time="showTime" />
</template>

<script lang="ts">
	import Vue from "vue";

	export default Vue.extend({
		inheritAttrs: true,
		props: {
			value: { type: Date, default: null },
			showTime: { type: Boolean, default: false },
		},
		model: {
			prop: 'value',
			event: 'select'
		},
		data() {
			return {
			};
		},
		mounted() {
		},
		methods: {
			dateSelect(e) {
				this.$emit('select', e);
			},
		},
	});
</script>

The following example not disabling the Calendar:

<DatePicker v-model="item.fromDate" :showTime="!item.allDay" 
:disabled="true" />

Maybe I am doing something wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants