custom form widget with a button, but the ng-click not working

jerryzheng
Tera Contributor

Hi Experts,

  I need to add a Cancel button  form, so I cloned the form, and simply added a button, a function to be triggered, nothing else changed, but  it seems the ng-click is not fire, i.e the function is not called by click the button, not sure if I miss anything trivial stuff? 

Thanks for any help!

Jerry

Here are the codes:

HTML part: added:

<span>
<button class="test" ng-click="confirmDelete()">
<span> Cancel </span> <span class="glyphicon glyphicon-trash"></span>
</button>

</span>

 

 

 

Client script part, added:

function confirmDelete(){
//spModal.alert('How do you feel today?');
spUtil.addInfoMessage("Hello, from confirm delete");
}

 

the button shows on the form from the portal at the position I want:, but nothing happen when clicking it

find_real_file.png

6 REPLIES 6

SanjivMeher
Kilo Patron
Kilo Patron

Can you try this

 

function confirmDelete(){
//spModal.alert('How do you feel today?');
alert("Hello, from confirm delete");
}


Please mark this response as correct or helpful if it assisted you with your question.

jerryzheng
Tera Contributor

Hi,

  just tried, still not working.  however, the function itself does work since I added the following in the client script part, it does generate the message even with my previous spUtil API when the page is reloaded, but the click still does nothing:

//add debug message here
spUtil.addInfoMessage("Hello, from the client script");
confirmDelete();

 

 

Thanks!

Confirm if you added this script to the client controller in the widget


Please mark this response as correct or helpful if it assisted you with your question.

SatheeshKumar
Kilo Sage
Check console for any errors!!