checkbox - Calling a function on an element inside xeditable form -


i have x-editable form several fields in it. i've show checkbox field here brevity. there edit button opens of elements editing , when click submit of elements saved. while in edit mode want able call function when checkbox clicked before submitting form. validation make sure user wants uncheck box. want prevent default behavior of checkbox , display dialog confirmation. simple regular checkbox can figure out how x-editable . ng-click doesnt seem work. can see example e-onclick works built in functions alert() , console.log().

<form editable-form name="tableform" onaftersave="save()"oncancel="cancel()">         <table>         <tr>             <th>active:</th>                 <td>                     <span editable-checkbox="user.active" e-form="tableform" e-onclick="console.log('test')"> {{user.active)}}                     </span>                 </td>         </tr>    </table> </form> 

i want thing this:

<span editable-checkbox="user.active" e-form="tableform" e-onclick="confirm($event)"> {{user.active)}}                     </span>  

and in controller this:

 $scope.confirm = function($event){             $event.preventdefault();             // show confirmation code          }; 

can try

<span editable-checkbox="user.active" e-form="tableform" e-ng-click="confirm()"> {{user.active)}}</span>  

and

 $scope.confirm = function(){            console.log("test")         }; 

this work


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -