My code is below from an Angular js file,
ctrl.issuesGridConfig = {
modelSetName: 'issues',
serializerChildName: 'issues', //will be prepended with "__" before fields for validation
actions: {
addRow: {
active: function(row) {return !ctrl.readOnly;},
callback: addIssueRow,
},
editRow: {
active: function(issue){ return issue.provider_issue_code;} ? true : false,
label: "View test" : "Edit",
callback: function(issue){
$location.path('/issue/' + issue.provider_issue_code);
}
},
deleteRow: {
active: function(row) {return !ctrl.readOnly;},
callback: function(row){
_.pull(ctrl.activity.issues, row);
}
}
},
My problem is- under the Editrow I am running the function(issue). it is working fine in callback:, but for active: it does not work. I get value of issue.provider_issue_code under callback:, but not under active:. I want to make active = true only if issue.provider_issue_code has some value. Please let me know whats going wrong here.
function(issue){ return issue.provider_issue_code;} ? true : falseThis line doesn't make any sense to me. You're defining a function, then testing if it exists, and if it exists, return true else return false. But it does exist since you're precisely defining it, soactivewill always be true...