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

KAction does not handle properly store binding #695

Open
cnouguier opened this issue Feb 21, 2023 · 1 comment
Open

KAction does not handle properly store binding #695

cnouguier opened this issue Feb 21, 2023 · 1 comment
Labels
bug core Issue affecting core module
Milestone

Comments

@cnouguier
Copy link
Contributor

Using configuration delcaration, it works fine as the store binding is done by the content utilities.
But if we delcare an action directly in the template it does not work.

<KAction
   id="toggle-operations"
   icon="las la-tasks"
   tooltip="SurveyToolbar.SHOW_OPERATIONS"
   :toggle="{ tooltip: 'SurveyToolbar.HIDE_OPERATIONS', value: ':store.layout.windows.left.visible' }"
 />
@cnouguier cnouguier added the bug label Feb 21, 2023
@cnouguier cnouguier added this to the v2.0.x milestone Feb 21, 2023
@cnouguier cnouguier added the core Issue affecting core module label Mar 29, 2023
@claustres
Copy link
Member

claustres commented Apr 19, 2023

In such case we should probably directly reference the store value in the component using a ref:

<KAction
   id="toggle-operations"
   icon="las la-tasks"
   tooltip="SurveyToolbar.SHOW_OPERATIONS"
   :toggle="{ tooltip: 'SurveyToolbar.HIDE_OPERATIONS', value: toggleValue }"
 />
<script setup>
import { Store } from '@kalisio/kdk/core.client'
const toggleValue= Store.getRef('layout.windows.left.visible')
</script>

A similar approach is used for the user object in e.g. KHome.

@claustres claustres moved this to Bugs in KDK Roadmap Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug core Issue affecting core module
Projects
Status: Bugs
Development

No branches or pull requests

2 participants