Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Document-Processing-toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -5582,6 +5582,11 @@
<li><a href="/document-processing/excel/spreadsheet/vue/how-to/create-a-object-structure">Create a object structure </a></li>
<li><a href="/document-processing/excel/spreadsheet/vue/how-to/change-active-sheet">Changing the active sheet while importing a file</a></li>
<li><a href="/document-processing/excel/spreadsheet/vue/how-to/identify-the-context-menu-opened">Identify the context menu opened</a></li>
<li><a href="/document-processing/excel/spreadsheet/vue/how-to/find-replace-in-range">Find and replace the text within the selected range of cells</a></li>
<li><a href="/document-processing/excel/spreadsheet/vue/how-to/add-dynamic-cell-template">Add dynamic cell templates</a></li>
<li><a href="/document-processing/excel/spreadsheet/vue/how-to/add-cell-icon">Add an icon to the cell</a></li>
<li><a href="/document-processing/excel/spreadsheet/vue/how-to/get-filtered-data">Get the filtered row data</a></li>
<li><a href="/document-processing/excel/spreadsheet/vue/how-to/paste-only-values-without-formatting">Paste only values without formatting and styles</a></li>
</ul>
</li>
<li><a href="/document-processing/excel/spreadsheet/vue/mobile-responsiveness">Mobile Responsiveness</a></li>
Expand Down
25 changes: 25 additions & 0 deletions Document-Processing/Excel/Spreadsheet/Vue/how-to/add-cell-icon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
layout: post
title: Add icons inside cells in Vue Spreadsheet component | Syncfusion
description: Learn here all about adding icon inside cells using a custom template in Syncfusion Vue Spreadsheet component of Syncfusion Essential JS 2 and more.
control: Spreadsheet
platform: document-processing
documentation: ug
---

# Add Custom Icons to Cells in Vue Spreadsheet

In the Syncfusion Spreadsheet, you can render custom icons inside specific cells by defining a custom template property within the cell model. During the [beforeCellRender](https://ej2.syncfusion.com/vue/documentation/api/spreadsheet/index-default#beforecellrender) event, the icon element can be appended to the corresponding table cell (td) by checking whether the cell contains this template property.

The following sample demonstrates how to add icons to cells by assigning the template property in the cell definition. Additionally, a custom ribbon item named "Add Icon" is included under a new "Template" ribbon tab. When this ribbon item is selected, the Spreadsheet dynamically inserts an icon into the currently active cell.

{% tabs %}
{% highlight html tabtitle="Composition API (~/src/App.vue)" %}
{% include code-snippet/spreadsheet/vue/add-icon-in-cell-cs1/app-composition.vue %}
{% endhighlight %}
{% highlight html tabtitle="Options API (~/src/App.vue)" %}
{% include code-snippet/spreadsheet/vue/add-icon-in-cell-cs1/app.vue %}
{% endhighlight %}
{% endtabs %}

{% previewsample "/document-processing/code-snippet/spreadsheet/vue/add-icon-in-cell-cs1" %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
layout: post
title: Dynamic cell template in Vue Spreadsheet component | Syncfusion
description: Render dropdown templates inside cells in Syncfusion Vue Spreadsheet component of Syncfusion Essential JS 2 and more.
control: Spreadsheet
platform: document-processing
documentation: ug
---

# Create Dynamic Cell Templates with Dropdowns in Vue Spreadsheet

You can add templates to cells in the Syncfusion Spreadsheet component by dynamically assigning a custom template property directly to individual cells. When a cell has this custom template property, you can use the [beforeCellRender](https://ej2.syncfusion.com/vue/documentation/api/spreadsheet/index-default#beforecellrender) event to append the desired template element to the cell.

The following sample demonstrates how to insert a [Syncfusion Dropdown component](https://www.npmjs.com/package/@syncfusion/ej2-dropdowns) into Spreadsheet cells using this custom template property. Additionally, a custom ribbon item named "DropDown List" is included under a new "Template" ribbon tab. When this ribbon item is selected, the Spreadsheet dynamically inserts a dropdown into the currently active cell.

{% tabs %}
{% highlight html tabtitle="Composition API (~/src/App.vue)" %}
{% include code-snippet/spreadsheet/vue/dynamic-cell-template-cs1/app-composition.vue %}
{% endhighlight %}
{% highlight html tabtitle="Options API (~/src/App.vue)" %}
{% include code-snippet/spreadsheet/vue/dynamic-cell-template-cs1/app.vue %}
{% endhighlight %}
{% endtabs %}

{% previewsample "/document-processing/code-snippet/spreadsheet/vue/dynamic-cell-template-cs1" %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
layout: post
title: Find and replace in range in Vue Spreadsheet component | Syncfusion
description: Learn here all about performing find and replace limited to the range in Syncfusion Vue Spreadsheet component of Syncfusion Essential JS 2 and more.
control: Spreadsheet
platform: document-processing
documentation: ug
---

# Find and replace the text within selected range of cells

In Syncfusion Spreadsheet, the "Replace All" action by default searches and replaces a text throughout the entire sheet, regardless of the selected range. To limit "Replace All" to only the selected range, you can customize the addressCollection based on the selectedRange in the [actionBegin](https://ej2.syncfusion.com/vue/documentation/api/spreadsheet/index-default#actionbegin) event when the action is `beforeReplaceAll`.

The following sample demonstrates how to limit the "Replace All" operation to the currently selected range.

{% tabs %}
{% highlight html tabtitle="Composition API (~/src/App.vue)" %}
{% include code-snippet/spreadsheet/vue/find-and-replace-cs1/app-composition.vue %}
{% endhighlight %}
{% highlight html tabtitle="Options API (~/src/App.vue)" %}
{% include code-snippet/spreadsheet/vue/find-and-replace-cs1/app.vue %}
{% endhighlight %}
{% endtabs %}

{% previewsample "/document-processing/code-snippet/spreadsheet/vue/find-and-replace-cs1" %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
layout: post
title: Retrieve filtered row data in Vue Spreadsheet component | Syncfusion
description: Learn here all about getting filtered row data in Syncfusion Vue Spreadsheet component of Syncfusion Essential JS 2 and more.
control: Spreadsheet
platform: document-processing
documentation: ug
---

# Get filtered row data in Vue Spreadsheet

Filtering in the Syncfusion Spreadsheet allows you to display only the rows that match your criteria, hiding all others. You can enable filtering by setting the [allowFiltering](https://ej2.syncfusion.com/vue/documentation/api/spreadsheet/index-default#allowfiltering) property, and apply filters either through the UI or programmatically using the [applyFilter](https://ej2.syncfusion.com/vue/documentation/api/spreadsheet/index-default#applyfilter) method. To identify which rows are filtered, iterate through the sheet's row collection and check the `isFiltered` property of each row object. This flag indicates whether a row is currently hidden due to filtering.

The following example shows how to get the filtered rows from the Spreadsheet:

{% tabs %}
{% highlight html tabtitle="Composition API (~/src/App.vue)" %}
{% include code-snippet/spreadsheet/vue/filter-cs2/app-composition.vue %}
{% endhighlight %}
{% highlight html tabtitle="Options API (~/src/App.vue)" %}
{% include code-snippet/spreadsheet/vue/filter-cs2/app.vue %}
{% endhighlight %}
{% endtabs %}

{% previewsample "/document-processing/code-snippet/spreadsheet/vue/filter-cs2" %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
layout: post
title: Paste Without Formatting in Vue Spreadsheet component | Syncfusion
description: Learn here about Paste only values without formatting during copy and paste in Syncfusion Vue Spreadsheet component of Syncfusion Essential JS 2 and more.
control: Spreadsheet
platform: document-processing
documentation: ug
---

# Paste Values Without Formatting and styles in Vue Spreadsheet

In the Syncfusion Vue Spreadsheet, you can make the paste action insert only the raw values into the cells, without bringing any formatting or styles from the copied content. This can be done by using the [actionBegin](https://ej2.syncfusion.com/vue/documentation/api/spreadsheet/index-default#actionbegin) event, where the Spreadsheet provides the details of the action being performed. When the action is a clipboard operation, you can set the paste type to Values, ensuring that only plain values are pasted into the sheet.

The following example shows how to paste values without formatting.

{% tabs %}
{% highlight html tabtitle="Composition API (~/src/App.vue)" %}
{% include code-snippet/spreadsheet/vue/paste-values-cs1/app-composition.vue %}
{% endhighlight %}
{% highlight html tabtitle="Options API (~/src/App.vue)" %}
{% include code-snippet/spreadsheet/vue/paste-values-cs1/app.vue %}
{% endhighlight %}
{% endtabs %}

{% previewsample "/document-processing/code-snippet/spreadsheet/vue/paste-values-cs1" %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<template>
<ejs-spreadsheet
ref="spreadsheet"
:created="onCreated"
:beforeCellRender="onBeforeCellRender">
</ejs-spreadsheet>
</template>

<script setup>
import { ref } from 'vue';
import {
SpreadsheetComponent as EjsSpreadsheet,
ColumnsDirective as EColumns,
ColumnDirective as EColumn,
RangesDirective as ERanges,
RangeDirective as ERange,
SheetsDirective as ESheets,
SheetDirective as ESheet
} from '@syncfusion/ej2-vue-spreadsheet';

const spreadsheet = ref(null);

const createPlusIconWrapper = () => {
const wrapperDiv = document.createElement('div');
wrapperDiv.className = 'e-custom-wrapper';
const iconSpan = document.createElement('span');
iconSpan.className = 'e-icons e-plus e-custom-icon';
wrapperDiv.appendChild(iconSpan);
return wrapperDiv;
};

const onCreated = () => {
const ss = spreadsheet.value && spreadsheet.value.ej2Instances;
if (!ss) return;

ss.updateCell({ template: 'plus-icon' }, 'A1');
ss.updateCell({ template: 'plus-icon' }, 'B1');
ss.updateCell({ template: 'plus-icon' }, 'C1');
ss.resize();

ss.addRibbonTabs([
{
header: { text: 'Template' },
content: [
{
text: 'Add Icon',
tooltipText: 'Initialize',
click: () => {
const inst = spreadsheet.value && spreadsheet.value.ej2Instances;
if (!inst) return;
const sheet = inst.getActiveSheet();
inst.updateCell({ template: 'plus-icon' }, sheet.activeCell);
inst.resize();
},
},
],
},
]);
};

const onBeforeCellRender = (args) => {
if (args.cell && args.cell.template === 'plus-icon') {
const wrapperDiv = createPlusIconWrapper();
args.element.insertBefore(wrapperDiv, args.element.firstChild);
}
};
</script>

<style>
@import '../node_modules/@syncfusion/ej2-base/styles/material.css';
@import '../node_modules/@syncfusion/ej2-buttons/styles/material.css';
@import '../node_modules/@syncfusion/ej2-dropdowns/styles/material.css';
@import '../node_modules/@syncfusion/ej2-inputs/styles/material.css';
@import '../node_modules/@syncfusion/ej2-navigations/styles/material.css';
@import '../node_modules/@syncfusion/ej2-popups/styles/material.css';
@import '../node_modules/@syncfusion/ej2-splitbuttons/styles/material.css';
@import '../node_modules/@syncfusion/ej2-grids/styles/material.css';
@import "../node_modules/@syncfusion/ej2-vue-spreadsheet/styles/material.css";
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<template>
<ejs-spreadsheet
ref="spreadsheet"
:created="onCreated"
:beforeCellRender="onBeforeCellRender">
</ejs-spreadsheet>
</template>

<script>
import {
SpreadsheetComponent,
ColumnsDirective,
ColumnDirective,
RangesDirective,
RangeDirective,
SheetsDirective,
SheetDirective
} from '@syncfusion/ej2-vue-spreadsheet';

export default {
name: 'App',
components: {
'ejs-spreadsheet': SpreadsheetComponent,
'e-sheets': SheetsDirective,
'e-sheet': SheetDirective,
'e-ranges': RangesDirective,
'e-range': RangeDirective,
'e-columns': ColumnsDirective,
'e-column': ColumnDirective
},
methods: {
createPlusIconWrapper() {
const wrapperDiv = document.createElement('div');
wrapperDiv.className = 'e-custom-wrapper';
const iconSpan = document.createElement('span');
iconSpan.className = 'e-icons e-plus e-custom-icon';
wrapperDiv.appendChild(iconSpan);
return wrapperDiv;
},
onCreated() {
const spreadsheet = this.$refs.spreadsheet && this.$refs.spreadsheet.ej2Instances;
if (!spreadsheet) return;
spreadsheet.updateCell({ template: 'plus-icon' }, 'A1');
spreadsheet.updateCell({ template: 'plus-icon' }, 'B1');
spreadsheet.updateCell({ template: 'plus-icon' }, 'C1');
spreadsheet.resize();
spreadsheet.addRibbonTabs([
{
header: { text: 'Template' },
content: [
{
text: 'Add Icon',
tooltipText: 'Initialize',
click: () => {
const ss = this.$refs.spreadsheet && this.$refs.spreadsheet.ej2Instances;
if (!ss) return;
const sheet = ss.getActiveSheet();
ss.updateCell({ template: 'plus-icon' }, sheet.activeCell);
ss.resize();
},
},
],
},
]);
},

onBeforeCellRender(args) {
if (args.cell && args.cell.template === 'plus-icon') {
const wrapperDiv = this.createPlusIconWrapper();
args.element.insertBefore(wrapperDiv, args.element.firstChild);
}
},
},
};
</script>

<style>
@import '../node_modules/@syncfusion/ej2-base/styles/material.css';
@import '../node_modules/@syncfusion/ej2-buttons/styles/material.css';
@import '../node_modules/@syncfusion/ej2-dropdowns/styles/material.css';
@import '../node_modules/@syncfusion/ej2-inputs/styles/material.css';
@import '../node_modules/@syncfusion/ej2-navigations/styles/material.css';
@import '../node_modules/@syncfusion/ej2-popups/styles/material.css';
@import '../node_modules/@syncfusion/ej2-splitbuttons/styles/material.css';
@import '../node_modules/@syncfusion/ej2-grids/styles/material.css';
@import "../node_modules/@syncfusion/ej2-vue-spreadsheet/styles/material.css";
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@











Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

<!DOCTYPE html>
<html lang="en">

<head>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js"></script>
<title>EJ2 Vue Sample</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Typescript UI Controls" />
<meta name="author" content="Syncfusion" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<link href="https://cdn.syncfusion.com/ej2/23.1.36/material.css" rel="stylesheet" />
<link href="index.css" rel="stylesheet" />
<script src="systemjs.config.js"></script>
</head>

<body>
<div id='app'>Loading....</div>
</body>

</html>

Loading