angularjs - Cell template in ng-grid -
I am using the ng-grid
property of cell template
I am I am defining a function in the instruction. Here is the code I am defining my grid-option
within the same instructions:
data: 'mydata', columnDefs: [{field: 'timeout', DisplayName: 'delay', cell template: '& lt; A href = "" ng-click = "report (warning, key, 1000,1,1);" "Gt; gt; & gt; '}] and the function report
is also defined in the same command.
ng-click
is working whenever The function is called, the function is being called, but whatever input variable i ( alert
and key
) is not going to function, while the other three Passing the parameter 1000,1, 1
alert
hard-coded string I want to pass which is one of the integer values in the key
'mydata'; I have checked using the warning
for these 2 specific values in the function and This is showing useless.
Please help to call the function correctly. Thanks in advance.
Do you want something like this:
$ Scope.Report = function (msg, key, v1, v2, v3) {// Usage v1, v2, v3 You want a warning (msg + ':' + key); }; $ Scope.gridOptions = {Data: 'myData', columnDefs: [[Field: 'name', displayName: 'delay', cell template: '& lt; A href = "" ng-click = "Report (\ 'Alert \', Row.entity.age, 1000,1,1);" gt; & Lt; Div class = \ "ngCellText \" & gt; {{Row.getProperty (col.field)}} & lt; / Div & gt; & Lt; / A & gt; '}, {Field:' age '}]};
Note that the hardcode string (msg) should be placed in quotes that are escaped. I used Age as an example for a key, because in this example it has a numerical value, you do not need a quote.
Here is a
Comments
Post a Comment