' Use strict '; App.controller (' Datatablectrl ', function ($scope, $compile) {$scope. searchfiles = {name: "", IP: ""}; $scope. Show = function () {alert ("DD"); } angular.element ("#Btnserach"). Click (function () {Table.draw (); }) var table = angular.element ("#datetable"). DataTable ({sajaxsource: '/home/index ', "Sservermethod": "POST", "bprocessing": true, "bserver Side ": True," bpaginate ": True, Aocolumns: [{data: ' id ', ' mrender ': function (da TA) {return ' <a ng-click= ' show () > Test </a> '; }, "Fncreatedcell": Function (NTD, SData, OData, IRow, Icol) {$compile (NTD) ($scope); }}, {data: ' title '}, {data: ' Add_time '}], " Sdom ":" tflt< ' Row Dtttfooter ' < ' col-sm-6 ' i>< ' col-sm-6 ' p>> ', "idisplaylength": Ten, "OtabletoOLs ": {" abuttons ": [" Copy "," CSV "," xls "," PDF "," print "]," Sswfpath ": "Assets/swf/copy_csv_xls_pdf.swf"}, "language": {"search": "", "Slengthmenu": "_menu _ "," Opaginate ": {" sprevious ":" Previous Page "," Snext ":" Next Page "}}, "Aasorting": [], "Fnserverparams": function (aodata) {Aodata.push ({"name": "Name", "Val UE ": $scope. Searchfiles.name}, {" Name ":" Ip "," value ": $scope. Searchfiles.ip}); } })});
<Divclass= "Widget-body"> <DivID= "Registration-form"> <formrole= "form"> <Divclass= "Form-title">Contact Us</Div> <Divclass= "Row"> <Divclass= "Col-sm-6"> <Divclass= "Form-group"> <label for= "ExampleInputEmail2">User name</label> <spanclass= "Input-icon icon-right"> <inputtype= "text"class= "Form-control"ID= "ExampleInputEmail2"placeholder= "User name"Ng-model= "Searchfiles.name"> <Iclass= "fa fa-envelope Blue"></I> </span> </Div> </Div> <Divclass= "Col-sm-6"> <Divclass= "Form-group"> <label for= "ExampleInputName2">IP Address</label> <spanclass= "Input-icon icon-right"> <inputtype= "text"class= "Form-control"ID= "ExampleInputName2"placeholder= "IP Address"Ng-model= "Searchfiles.ip"> <Iclass= "Glyphicon glyphicon-user palegreen"></I> </span> </Div> </Div> </Div> <ButtonID= "Btnserach"type= "button"class= "Btn Btn-danger">Search</Button> </form> </Div> <TableID= "Datetable"class= "Table table-striped"> <thead> <TR> <thstyle= "width:30%">First Name</th> <thstyle= "width:30%">Last Name</th> <thstyle= "width:40%">Phone #</th> </TR> </thead> <tbody></tbody> </Table> </Div>
Angular JS using jquery DataTable Custom Search button click event and Mrender Ng-click event