# file-manager-enable-disable-toolbar-item

> File manager with external buttons that enable or disable the New Folder toolbar item at runtime.

**Framework:** vue  **Component:** FileManager  **Variant:** enable-disable-toolbar-item

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/vue/file-manager-enable-disable-toolbar-item.json
```

**Install Package(s)**

```bash
npm install @syncfusion/ej2-vue-filemanager @syncfusion/ej2-vue-buttons
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/file-manager-enable-disable-toolbar-item/FileManager.vue

```vue
<template>
  <div class="control-section file-toolbar-state">
    <div class="sample-container">
      <ejs-button id="enable" cssClass="e-success">Enable New Folder toolbar item</ejs-button>
      <ejs-button id="disable" cssClass="e-danger">Disable New Folder toolbar item</ejs-button>
      <ejs-filemanager
        :created="onCreated"
        id="file-manager"
        ref="fileManagerinstance"
        :height="height"
        :ajaxSettings="ajaxSettings"
      />
    </div>
  </div>
</template>

<script lang="ts">
import { FileManagerComponent, DetailsView, NavigationPane, Toolbar } from '@syncfusion/ej2-vue-filemanager';
import { ButtonComponent } from '@syncfusion/ej2-vue-buttons';

export default {
  components: {
    'ejs-button': ButtonComponent,
    'ejs-filemanager': FileManagerComponent
  },
  data() {
    return {
      ajaxSettings: {
        url: 'https://physical-service.syncfusion.com/api/FileManager/FileOperations',
        getImageUrl: 'https://physical-service.syncfusion.com/api/FileManager/GetImage',
        uploadUrl: 'https://physical-service.syncfusion.com/api/FileManager/Upload',
        downloadUrl: 'https://physical-service.syncfusion.com/api/FileManager/Download'
      },
      height: '375px'
    };
  },
  provide() {
    return {
      filemanager: [DetailsView, NavigationPane, Toolbar]
    };
  },
  methods: {
    onCreated() {
      // Click event for enable button
      (document.getElementById('enable') as HTMLElement).addEventListener('click', () => {
        // Enable new folder toolbar item
        (this.$refs.fileManagerinstance as any).enableToolbarItems(['newfolder']);
      });
      // Click event for disable button
      (document.getElementById('disable') as HTMLElement).addEventListener('click', () => {
        // Disable new folder toolbar item
        (this.$refs.fileManagerinstance as any).disableToolbarItems(['newfolder']);
      });
    }
  }
};
</script>

<style scoped>
.file-toolbar-state .sample-container {
  margin: 10px 10px 10px 10px;
}

.file-toolbar-state #enable {
  position: relative;
  left: 20%;
  top: -10px;
}

.file-toolbar-state #disable {
  position: relative;
  left: 30%;
  top: -10px;
}
</style>

```
