Is it possible to change table selection appearence?

I want to change table selection appearence like below.


As you see it shows selected cells as blocked area. But ej2-vue-richtexteditor table is change it's border color only So it's hard to recognize it's state of selection.

Is it possible to change it's appearence for selected cells?

If it's possible then How can I do that?


And I want to change the cursor style when hovering on selected cells as default cursor style.


Can I change it's cursor style?

Then let me know how can I change it.


Thanks.


7 Replies 1 reply marked as answer

VJ Vinitha Jeyakumar Syncfusion Team August 25, 2022 06:57 AM UTC

Hi Kyung,


Your requirement to change the background color of the selected cells and cursor styles while hovering over the selected cells in the tables of Rich Text Editor can be achieved by customizing the below CSS styles code.

Code snippet:
<style>
.e-richtexteditor .e-rte-content .e-content table td.e-cell-select,
.e-richtexteditor .e-rte-content .e-content table th.e-cell-select {
  background-color: lightgrey;
  cursor: context-menu;
}
</style>



Regards,
Vinitha

Marked as answer

KR Kyung-hyun Roh replied to Vinitha Jeyakumar August 25, 2022 08:54 AM UTC

It works!

Thanks!



VJ Vinitha Jeyakumar Syncfusion Team August 26, 2022 05:15 AM UTC

Hi Kyung,


You are always welcome.

Regards,
Vinitha


KR Kyung-hyun Roh replied to Vinitha Jeyakumar September 7, 2022 04:21 AM UTC

Hi Vinitha,

I got some problem.

Copying selected table's cell background is affected to new copied cell.

Video linke: https://youtu.be/upa_9hSiGZw



VJ Vinitha Jeyakumar Syncfusion Team September 8, 2022 10:30 AM UTC

Hi Kyung,


We have tried to replicate the reported issue at our end. but unfortunately, we didn't face the reported issue while copy and pasting the selected cells. please check the video illustration for your reference,


Can you please share us with the exact issue reproducing steps and issue replicating sample to further validate on our end.

Regards,
Vinitha


KR Kyung-hyun Roh replied to Vinitha Jeyakumar September 14, 2022 01:09 AM UTC

As you see below It's selected border style is copied on new table.


Reproducing steps:


  1. make table 3 x 4
  2. input texts
  3. drag text from second cell to third cell
  4. Ctrl + C
  5. Paste it under the table



asfeasefasfeaefeasfeaseffef
fasfasfeasfefefasefasfesafeef
sefasfeasefasefefefasefefe

asfeasfe


asefasfeaefeasfeaseffef


asfeasfeasefasfesafe


asfeasfeasefasfesafe


asefasefasef


RK Revanth Krishnan Syncfusion Team September 14, 2022 03:04 PM UTC

Hi Kyung,


We have validated your query and we are able to replicate the reported issue on our end. This issue occurs because when copying the table cells, by default, the selected cell has the border styles, which are also copied, so when pasted, the styles with the border selected are pasted. This issue can be resolved by removing the class ‘e-cell-selected’ and replacing the border styles with the default border styles of the table in the “afterPasteCleanup” event. We have prepared a sample for your reference.


Code Snippet:

<template>

  <div>

    <ejs-richtexteditor :toolbarSettings="toolbarSettings" :afterPasteCleanup="afterPasteCleanupEvent"></ejs-richtexteditor>

  </div>

</template>

 

<script>

import {

  . . .

  PasteCleanup,

from "@syncfusion/ej2-vue-richtexteditor";

 

export default {

  . . .

  methods: {

    afterPasteCleanupEventfunction (args) {

      var tempElem = document.createElement("div");

      tempElem.innerHTML = args.value;

      var borderStyle;

      if (tempElem.querySelector('td:not([class="e-cell-select"])') != null) {

        borderStyle = tempElem.querySelector('td:not([class="e-cell-select"])').style.border;

      } else {

        borderStyle = "1px solid black";

      }

      var borderRemoveElem = tempElem.querySelectorAll('td[class="e-cell-select"]');

      for (var i = 0; i < borderRemoveElem.length; i++) {

        borderRemoveElem[i].classList.remove("e-cell-select");

        borderRemoveElem[i].style.border = borderStyle;

      }

      args.value = tempElem.innerHTML;

    },

  },

  . . .

  provide: {

    richtexteditor: [Toolbar, Link, Image, HtmlEditor, Table, PasteCleanup],

  },

};

</script>


Sample: https://codesandbox.io/s/bold-night-kshz5j?file=/src/App.vue

Documentation: https://ej2.syncfusion.com/vue/documentation/rich-text-editor/paste-cleanup/

API Reference: https://ej2.syncfusion.com/vue/documentation/api/rich-text-editor/#afterpastecleanup


Please check the above code snippet, the sample, and the documentation and let us know if it resolves the issue on your end.


Regards,

Revanth


Loader.
Up arrow icon