({
doInit : function(component, event, helper) {
component.set(v.columns[
{label: 'Department ID', fieldName: 'DepartmentID', type: 'Auto Number'},
{label: 'Department Name', fieldName: 'Name', type: 'text'},
{label: 'Department Manager', fieldName: 'DepartmentManager', type: 'text'},
{label: 'Employee Count', fieldName: 'NoofEmployee', type: 'number'}
]);
var action= component.get("c.getRecord");
action.setCallback(this, funtion(response){
var state=response.getState();
if(state==="SUCCESS"){
component.set("v.dept",response.getReturnValue());
}
else{
console.log("Failed with state: " + state);
}
});
$A.enqueueAction(action);
}
})
Best Answer
On top of what @sfdcfox has mentioned, your issue is on this line:
You are missing a c in the word function. You need to have it as: