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

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

 

1 Reply

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 


Loader.
Live Chat Icon For mobile
Up arrow icon