awa.ui.CollectionGrid.Column Class
Defined in:
Module: awa.ui
/var/www/azaleahealth.com/branches/docs/source_repo/awa/resources/apps/js/awa/ui/CollectionGrid.js:6
Not really a class but just an outline for how a column should be written.
{
//required, used for sorting and for where to pull data from
id: 'pim_administered_date',
//column header. pulled from the model's attributeProps name property if not set in the column descriptor
name: 'Administered',
//a function that is passed the value, attributeName, and model in that order.
//pulled from the model's attributeProps name property if not set in the column descriptor
displayMethod: awa.func.strucword,
//allows the grid to be sorted
sort: true,
//you can provide a column tpl function if desired. the template is passed an args object with item property that has all
//of the models properties in display format and a model property with the model itself.
tpl: undefined,
//must return a string
build: function(item, model){
return "";
}
}
//or
{
id: 'actions',
sort: false,
buttons:[
{
type: "gray",icon:"check16",tip: "Enable Reason",className: "enable",
condition: function(args){
//args has model property and an item property
//use those to determine if a button should display or not
return true;
}
callback: function(args){
args.model.set('rr_disabled', '');
args.model.save().done(function(){
self.refresh();
});
},
context: self
}
]
}
Methods
build
(
-
item -
model
builds output, takes (attributes, model)
Parameters:
-
itemObjectThe displayJSON version of the Model.
-
modelawa.Model
displayMethod
(
-
value -
attributeKey -
model
Display function, takes (value, attributeKey, model)
Parameters:
-
valueString -
attributeKeyString -
modelawa.mvc.Model
Properties
icon
String | Function
Used for icons
id
String
Unique key, usually sent back for sorting
name
String
Header label
orderBy
String
Allows override of orderBy column sent to server
sort
Boolean
dictates if sortable
Default: true