pass the column value when checkbox is clicked in wijmogrid column

限于喜欢 提交于 2019-12-25 05:33:17

问题


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);

        }

回答1:


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



来源:https://stackoverflow.com/questions/30241249/pass-the-column-value-when-checkbox-is-clicked-in-wijmogrid-column

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!