I am trying to understand someone else's codes. He has
task.prototype.taskAttributes = {
'header' : [
{'name' : 'display_type', 'display' : 'Display Type', 'type' : 'select', 'options' : {
'default' : 'Default',
name1 : 'Peter',
name2 : 'Ted',
}
},
{'name' : 'background', 'display' : 'Background', 'type' : 'image'},
{'name' : 'background_position', 'display' : 'Background Position', 'type' : 'text'},
{'name' : 'credit', 'display' : 'Background Credit', 'type' : 'text'}],
'input' : [
{'name' : 'display_type', 'display' : 'Display Type', 'type' : 'select', 'options' : {
'default' : 'Default',
title1 : 'manager',
title2 : 'employee'}
},
{'name' : 'background', 'display' : 'Background', 'type' : 'image'},
{'name' : 'background_position', 'display' : 'Background Position', 'type' : 'text'},
'image' : [{'name' : 'column', 'type' : 'select', 'options' : ['', 'left', 'right']}]
}
I am not sure if 'header' and 'input' are the object properties?
What are the attributes under 'header' and 'input'
What do these do:
{'name' : 'display_type', 'display' : 'Display Type', 'type' : 'select', 'options' : {
'default' : 'Default',
name1 : 'Peter',
name2 : 'Ted',
}
},
{'name' : 'background', 'display' : 'Background', 'type' : 'image'},
{'name' : 'background_position', 'display' : 'Background Position', 'type' : 'text'},
{'name' : 'credit', 'display' : 'Background Credit', 'type' : 'text'}],
I thought to declare object properties, we do
attribute={header:'header', input:'input'}
and I am not sure why he has so many atttriubes.
Thanks for the help guys!
header,inputandimageare arrays of objects (notice the square brackets:[and]).