# Chamar uma ação de widget de outro widget

**URL:** <https://meta.discourse.org/t/call-a-widget-action-from-another-widget/234292>\
**Category:** Product Support\
**Created:** [28 Julho , 2022 16:54 UTC](https://meta.discourse.org/t/call-a-widget-action-from-another-widget/234292 "2022-07-28T16:54:55Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lcor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lcor/32/249044_2.png) [@lcor](https://meta.discourse.org/u/lcor)\
**Post date:** [2 Agosto , 2022 15:30 UTC](https://meta.discourse.org/t/call-a-widget-action-from-another-widget/234292/2 "2022-08-02T15:30:43Z")

</div>

Encontrei uma solução, usando `createWidgetFrom` e importando o widget de cabeçalho:

```plaintext
import {
  default as header
} from "discourse/widgets/header";

```

Isso me permitiu acessar o escopo do método de ação `toggleSearchMenu`.

---

_[View the full topic](https://meta.discourse.org/t/call-a-widget-action-from-another-widget/234292)._
