Search code examples
javascriptangularjswijmowijgrid

Angular JS click event is not working in wijgrid colum


I am using wijgrid component in angular js there I got the problem that unable to perform click events on it.in wijgrid html components are not compiled , find the html code

<wij-grid  id = "dataGrid" allow-sorting="true" data="data" columns-autogeneration-mode="none" allow-paging="true" >
  <columns>
     <column data-key="name" header-text="Name"></column>
     <column data-key="address" header-text="Address" ></column>
     <column data-key="submit" header-text="Submit"></column>
   </columns>
</wij-grid>     

and my angular js code

$http.get(url,data).success(
        loadData);  

function loadData(responseData) {
if (responseData != null) {
    var data = responseData;
    for (index = 0; index < data.length; index++) {
        data[index].address =   data[index].addressLineOne+","+data[index].addressLineTwo;                                  
        $SubmitBtn  = "<a href='javascript:void(0);ng-click='submitCode("+data[index].reviewId+",true)'>Approve</a>";   data[index].submit=$ASubmitBtn;                                     
    }
    $scope.data = data;
    $("#content").wijtabs();
  }
}    
$scope.submitCode= function(id, status) {
alert(id+" "+status)
} 

HERE submit code function is not calling and in view source the function is showing with id and status.. which means it is not compiling in wijgrid module please help me to provide the solution. I tried to compile code $compile($sumitBtn)($scope) but it doesnt works , please suggest me s0lution


Solution

  • I got the solution using cellformatter method there i changed the code according to my requirement

    $scope.formatter = function(args) {
    if(args.row.dataRowIndex < 0 ) 
    return false;
    args.$container
    .html($compile(
    args.formattedValue)
    ($scope));
    return true;    
    }