pass an html Dataset to resource element

Hello,
I need to personalize the HTML div that represents the resource (view snippet below)

I need to add some data-mycustomdata dataset to the div with class e-resource-text, data become from my model (MVC).
It is possible?




1 Reply 1 reply marked as answer

RV Ravikumar Venkatesan Syncfusion Team November 4, 2020 10:42 AM UTC

Hi Gabriele, 

Greetings from Syncfusion support. 

We have validated your reported query at our end. We have achieved your requirement with the help of the renderCell event of the Schedule with the help of the below code. We have prepared a sample for your reference and it can be available below. 

[Index.cshtml] 
<ejs-schedule renderCell="onRenderCell"> 
</ejs-schedule> 
 
<script type="text/javascript"> 
    function onRenderCell(args) { 
        if (args.elementType === "resourceHeader" && args.element.classList.contains('e-child-node')) { 
            args.element.querySelector('.e-resource-text').setAttribute('data-your-custom-attribute', 'your-custom-attribute-value'); 
        } 
    } 
</script> 


Kindly try the above sample and get back to us if you need any further assistance. 

Regards, 
Ravikumar Venkatesan 


Marked as answer
Loader.
Up arrow icon