We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Bunch of questions about document editor implementation.

1. How to get a listener activated when cursor is in a table. Looking for an event listener.
2. How to get page count placed in the footer
3. How to get header or footer content left, center, right alignment
4. Nothing to do with document editor, where is the list of css class icon list in the documentation.

Thanks for the help

 

3 Replies

RT Ramya Thirugnanam Syncfusion Team January 4, 2019 09:54 AM UTC

Hi Sampurnima, 
 
Please find the responses to your queries as below. 
 
Query  
Response  
How to get a listener activated when cursor is in a table. Looking for an event listener. 
We can achieve your requirement by using selectionChange event of Document Editor and ContextType property of selection module. This  selectionChange” event is triggered every time when selection is changed.  
 
 
 
 
Please find the code example to achieve your requirement as below. 
 
/** 
* Initialize document editor 
*/ 
let documentEditor: DocumentEditor = new DocumentEditor(); 
 
documentEditor.selectionChange = (): void => { 
if (documentEditor.selection.contextType.indexOf('Table') !== -1) { 
    // Add your event listener code here 
        alert("Cursor is inside table"); 
    } 
} 
 
 
How to get page count placed in the footer 
We can get the page count by using “insertPageCount” property in Editor module and which insert page count in current cursor position. Please find the sample code below  
 
// Insert Page count at current cursor position 
documentEditor.editor.insertPageCount(); 
 
 
How to get header or footer content left, center, right alignment 
Document content can be aligned left/ center/ right by using “selectionParagraphFormat” in Selection module. 
 
 
Sample Code 
//To Right Align selected content  
documenteditor.selection.paragraphFormat.textAlignment = 'Right'; 
 
//To Left Align selected content  
documenteditor.selection.paragraphFormat.textAlignment = 'Left'; 
 
//To Center Align selected content  
documenteditor.selection.paragraphFormat.textAlignment = Center; 
 
 
Nothing to do with document editor, where is the list of css class icon list in the documentation. 
We don’t have list of CSS classes used in our component. But, we have list of icons which we used in our component. Please find the list of icons from the following line. 
 
 
 
Regards, 
Ramya T 



AM aman December 6, 2022 03:47 AM UTC

i want to know is there any way to remove document editor query selector error which comes out of no where



DS Dhanush Sekar Syncfusion Team December 15, 2022 08:56 AM UTC

Sorry for the delay, Aman.

If you are using multiple document editor component instances in your application, could you please try with a different ID to create the document editor component?

We suspect that you were using multiple document editor components with the same ID.

If you are still facing this issue, please provide more information about the issue and a sample application.


Loader.
Live Chat Icon For mobile
Up arrow icon