How to remove a style

Hi,

I'm currently working on styles in the document editor,
I can get the list of styles tanks to the getStyles function
I can add a style (nice dialog) etc.

But, how can I delete a style? I didn't find out how, I was thinking about searching in the sfdt JSON then reload the document with but hmm.. It seems kinda brutal.

Is there any simpler solution?

Thank's in advance,

regards,
François

8 Replies

SM Suriya Murugan Syncfusion Team March 4, 2020 10:26 AM UTC

Hi Francois, 

Currently, DocumentEditor doesn’t have options to remove style.  
Can you please share your use case scenario for removing the style?  that will helpful for us to investigate further and provide you solution at earliest. 

Regards, 
Suriya M. 



FR François March 4, 2020 10:46 AM UTC

Hi Suriya,

sure, I'm working for people using a lot Word, so my design goal is to showing styles in a list layout, I would like to save their custom styles to reapply them in my clients's new documents so they don't have to re create them all the time. But if they can't delete them they might be spamed by unused styles.



Well, I'll code something for that, that's ok, I'm still in love of the documentEditor :)
after submitting I was thinking that there is no delete option maybe to prevent errors about paragraphs using this style.

Ps: I opened an issue on github about default styles translation, it doesn't replace "Heading 1..2..3..." but append other styles in the dialog styles that creates an error if you try to modify them

Here is a screenshot with french translations from your repo

 

Regards,
François

 



SM Suriya Murugan Syncfusion Team March 5, 2020 05:23 PM UTC

Hi Francois, 

Currently, we are checking reported scenario and will share details by March 6,2020. 

Regards, 
Suriya M. 



SM Suriya Murugan Syncfusion Team March 6, 2020 11:02 AM UTC

Hi Francois, 

We have logged the defect report for the issue in "error if you try to modify translated style" . We will fix this issue and include in our EJ2 patch release which is scheduled on April 1, 2020. 

Regards, 
Suriya M. 



HC Harini Chellappa Syncfusion Team April 1, 2020 09:29 AM UTC

Hi Francois, 

We are sorry for not making this possible to include the fix for the below reported issue in current release. Fix will be included in our upcoming EJ2 patch release which is tentatively scheduled on April 8, 2020. Once included, we will update you. 

Regards, 

Harini C 



HC Harini Chellappa Syncfusion Team April 9, 2020 06:15 AM UTC

Hi Francois, 

We are glad to announce that our EJ2 patch release v18.1.43 has been rolled out successfully and included the fix for the reported scenario in this release.  

Kindly upgrade your NPM packages to latest version to resolve the reported issue.  


Release Notes  


Regards, 

Harini C 



FR François April 9, 2020 08:16 AM UTC

Hi Suriya and Harini,

Thank's for the feedback!

So I upgraded to the version 18.1 earlier this week, good work!

I don't get any errors now, but I have some questions for you guys: 

  • Does the document editor will have a function to remove styles ?
  • Using the locale json file (https://github.com/syncfusion/ej2-locale/blob/master/src/fr.json), there is 2 entries for the document editor, one called "documenteditor" (I'm using it for now), and "DocumentEditor", should I use both of them? I've made a custom file containing only translations I need, I don't want to import all translations because I only use few components.
  • In the style dialog, when I select "Heading 1" for example, by clicking on "Modify" button, rename doesn't work and it generates a new style with the new name, Heading 1 got the modification I made (like font color) but the name doesn't change.
  • The default styles are still not translated despite the translations are imported : 


    The result in the dialog seems ok for the labels but not for the headings : 


regards,
François



HC Harini Chellappa Syncfusion Team April 9, 2020 12:17 PM UTC

Hi François, 
 
Please find the details of your query from below table. 
 
Does the document editor will have a function to remove styles? 
 
Currently, document editor doesn’t provide any API to remove the styles. 
Using the locale json file (https://github.com/syncfusion/ej2-locale/blob/master/src/fr.json), there is 2 entries for the document editor, one called "documenteditor" (I'm using it for now), and "DocumentEditor", should I use both of them? I've made a custom file containing only translations I need, I don't want to import all translations because I only use few components. 
Please proceed to use the same ‘documenteditor’ which you are using currently.  
 
“DocumentEditor” is older one, not updated. 
 
 
In the style dialog, when I select "Heading 1" for example, by clicking on "Modify" button, rename doesn't work and it generates a new style with the new name, Heading 1 got the modification I made (like font color) but the name doesn't change. 
We will check on this and update your further details on this by April 14, 2020. 
he default styles are still not translated despite the translations are imported : 


The result in the dialog seems ok for the labels but not for the headings : 
 
Styles dropdown displayed in style dialog are document level styles, hence locale value will not be updated for those styles.  
 
Below defined locale values will be updated in table of contents dialog.  
 
 

Regards, 

Harini C 


Loader.
Up arrow icon