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

Adding custom button in Left Corner

Hello,

I'd like to add my own button in the top/left corner zone, but i did not find how i can do it, i've tried using the DOM but the element is not finded and when i get the parent it has no children ? maybe the scheduler is not totally loaded in the DOM ? i'm trying accesing it with this method(actionComplete)='onActionComplete($event)'
can you help me ?

let headerBar: HTMLElement = document.getElementsByClassName('e-resource-left-td')[0] as HTMLElement; // return undefined ???

let tdResourceLeft: Element = document.getElementsByClassName('e-table-container')[0]; // finded but has no children ???

Thanks !




3 Replies

KK Karthigeyan Krishnamurthi Syncfusion Team August 7, 2019 07:45 AM

Hi Chevron 
  
Syncfusion greetings. 
 
We can achieve your requirement using renderCell event and kindly refer the below sample. 
 
onRenderCell(args: RenderCellEventArgs): void { 
    if (args.elementType === 'emptyCells') { 
      if (args.element.querySelector('.e-resource-left-td button') === null) { 
        let inputEle: HTMLInputElement = createElement('button', { 
          className: 'e-field', innerHTML: 'Click Me', attrs: { name: 'EventType', value: 'Click Me', onClick: 'alert("Button Clicked")' } 
        }) as HTMLInputElement; 
        args.element.appendChild(inputEle); 
      } 
    } 
  } 
 
 
Regards, 
Karthi 



CH chevron August 8, 2019 05:53 AM

Thanks a lot!


KK Karthigeyan Krishnamurthi Syncfusion Team August 8, 2019 07:45 PM

Most welcome 😊 


Loader.
Live Chat Icon For mobile
Up arrow icon