Click Event in Action button

In the card, can i achieve a click event of the action button using the rel='nofollow' href tag in the syntax. In the tag below for rel='nofollow' href, i have a function in JavaScript that is being called but it always fails. 


var cardBook = [{

      header_title: ' My Work',

      header_subtitle: ' Items i need to approve.',

      cardImage: {

         url: 'mywork.png',

         tag: 'mywork'

      },

      cardContent: ' ',

      card_action_btn: {

         action_btns: [{

            tag: 'b',

     rel='nofollow' href: 'doURL()',

            target: '_blank',

            text: 'Launch'

         }],

         isVertical: true

      },

      isHorizontal: false

   }]


1 Reply

YS Yohapuja Selvakumaran Syncfusion Team October 17, 2024 11:54 AM UTC

Hi Naveen Davuluri,


Thank you for reaching out to us! We appreciate your inquiry.


Based on your requirement to add an rel='nofollow' href within a button, we have reviewed the scenario and created a sample that demonstrates how to include an rel='nofollow' href inside the button element of a card component. This approach allows you to combine both actions within the card’s buttons for better user interaction.


Here’s a simple example of how this can be achieved:


Code Snippet:


 

<div class="e-card">

        <div class="e-card-actions e-card-vertical">

          <button class="e-card-btn">More</button>

          <a rel='nofollow' href="#">Share</a>

        </div>

      </div>

 

 


In this example, we have two action elements: a button labeled "More" and a hyperlink labeled "Share." The hyperlink includes the rel='nofollow' href attribute to direct users to a specific URL when clicked.


You can explore the fully functional sample in the link provided below, which demonstrates this implementation in more detail:


Sample:  https://stackblitz.com/edit/kqqfja-7trjvm?file=index.html 


Additionally, for more information and to explore further customization options with the card component's action buttons, you can refer to the following documentation:


Documentation:  https://ej2.syncfusion.com/documentation/card/action-buttons

If you have any further questions or need additional clarification, feel free to get in touch. We are always here to assist you.




Regards,

Yohapuja S



Loader.
Up arrow icon