High-Performance UI Component Library for Enterprise Applications Forums Editor & Inputs Are there examples of using Smart.DateInput with state management (like Redux, V

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #113622
    emily.thorne91
    Participant

    Hi everyone, I am working on an internal admin dashboard with Input. I am currently trying to solve this: Are there examples of using Smart.DateInput with state management (like Redux, VUEx, etc.)? How to sync global and local state? So far, I tested with both static data and API data, but performance drops once the dataset grows. What approach would you recommend here?

    #113633
    admin
    Keymaster

    Hi,

    For Smart.DateInput, the cleanest pattern is to keep the application state as the single source of truth and treat the component value as a controlled input. The component should handle user interaction, while Redux/Vuex/Pinia (or another store) owns the selected date value.

    A typical flow is:

    1. Store the date value in your global state.
    2. Bind Smart.DateInput’s value to that state.
    3. Listen for the component’s change event.
    4. Dispatch an action/update the store when the user changes the date.
    5. Let the store update flow back into the component.

    Example with Vue-style state management:

    <smart-date-input
        :value="selectedDate"
        @change="onDateChange">
    </smart-date-input>
    
    computed: {
        selectedDate() {
            return this.$store.state.filters.date;
        }
    },
    methods: {
        onDateChange(event) {
            this.$store.commit('setDate', event.detail.value);
        }
    }

    Regards,
    Markov

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.