Customizing Specific Pages

Up until this point, you have only seen high-level config options and concepts. In this and the following sections, we will discuss customizations at the page level (on One.model.ModelFormPanel). This is done using several config options on the ModelFormContainer class. Each one is an object which gets passed into a specific page when it is constructed They are listed below:

  • defaultConfig: config options in here apply to every page

  • detailConfig: these apply only to the detail page

  • actionConfig: apply only to action pages

  • perActionConfig: this is a map of action name to config, and each gets applied to the specific action page

Here's a small example demonstrating how to use these properties, expanding upon the basic example:

define(function(){
 
Ext.ns('SHOW');
SHOW.TaskDetail = Ext.extend(One.model.ModelFormContainer, {
 
modelInfo: { modelLevelType: 'SHOW.Task' }
,createActionName: 'SHOW.CreateTask'
,detailViewName: 'SHOW.TaskDetail'
 
,defaultConfig: {
layoutStrategy: {
buildLayout: function(fields) {
// ... layout implementation ...
}
}
}
 
,detailConfig: {
// this config applies only to the detail page
}
 
,actionConfig: {
// this config applies to all action pages
}
 
,perActionConfig: {
'SHOW.CreateTask': {
values: {
'Priority': 'Medium'
// ... more default values ...
}
}
}
});
});