angularjswijmo

pass the column value when checkbox is clicked in wijmogrid column


i am trying to pass on the column value to the function when the particular column is clicked using ng-click of angular in wijmo grid column.I am getting undefined as value. How do we pass on the associated column value/row value when the checkbox is selected for each row.

my code:

HTML

<wj-flex-grid items-source="instances">
       <wj-flex-grid-column header="Select" >
                <input type="checkbox" binding = "machinename" ng-click= "model.funcall(args)"/>
        </wj-flex-grid-column>
        <wj-flex-grid-column header="Application" binding="appname" ></wj-flex-grid-column>
        <wj-flex-grid-column header="Server" binding="machine"></wj-flex-grid-column>
        <wj-flex-grid-column header="Instance" binding="instancename"></wj-flex-grid-column>
        <wj-flex-grid-column header="Last Updated" binding="lastupdated"></wj-flex-grid-column>
        <wj-flex-grid-column header="Status" binding="state"></wj-flex-grid-column>
        <wj-flex-grid-column header="Error" binding="error"></wj-flex-grid-column>
        </wj-flex-grid>

JS

$scope.model.funcall = function funcall(args){
            console.log("function called");
            console.log(args);

        }

Solution

  • You should replace args with $item in order to get the dataItem of that particular row. Here is the code:

    input type="checkbox" binding = "machinename" ng-click= "model.funcall($item)"/>

    For more details on $item, you can refer to the following doc link: http://wijmo.com/5/docs/topic/wijmo.angular.WjFlexGridCellTemplate.Class.html