Skip to content

Instantly share code, notes, and snippets.

@pierr
Last active August 29, 2015 14:10
Show Gist options
  • Save pierr/7030a6adad86be74597f to your computer and use it in GitHub Desktop.
Save pierr/7030a6adad86be74597f to your computer and use it in GitHub Desktop.
Focus view options
{
/**
* Does the view has to load the model from the service define in `getModelSvc`.
* @type {Boolean}
*/
isModelToLoad: true, //By default the model is loaded.
/**
* If true, there is an edit mode in the view.
* @type {Boolean}
*/
isEditMode: true,
/**
* If there is an edit mode and this property is true, the view can start in edit mode. The templateEdit will be rendered.
* @type {Boolean}
*/
isEdit: false,
/**
* If true, the view will navigate to the `generateNavigationUrl` url.
* @type {Boolean}
*/
isNavigationOnSave: true,
/**
* If true, the view will navigate to the `generateDeleteUrl` url.
* @type {Boolean}
*/
isNavigationOnDelete: true,
/**
* If true, the view will attempt to call the `saveModelSvc` in the `saveAction` when there is a submit.
* If you have a composite or a list view, maybe you want the parent view to deal with the save.
* @type {Boolean}
*/
isSaveOnServer: true,
/**
* When the view is a list view, this selector is use to identify the view of each line.
* It could be `ul li`.
* @type {String}
*/
collectionSelector: "tbody tr",
/**
* If there is no navigatio on save, and dhis parameter is true, the view attempt to reload the page (using Backbone not the naigator refresh).
* @type {Boolean}
*/
isForceReload: false,
/**
* This parameter is use in order to know if the view is ready to be displayed.
* If not, the spinner is render (see isReady function).
* @type {Boolean}
*/
isReadyModelData: true,
/**
* This parameter can be use in order to have a back to the list button.
* @type {string}
*/
listUrl: undefined,
/**
* If true, the view will listen to the `model:change` event.
* @type {Boolean}
*/
isListeningToModelChange: true,
/**
* If you need to specify a selector in which the input, select, textarea are searched.
* @type {string}
*/
formSelector: undefined, //In whitch selector you have to search the form datas (inputs, select,...).,
/**
* Define if the type of model of the view is a model or a collection.
* @type {String}
*/
modelType: "model"
}
customOptions:{
isEdit:false,
isEditMode: false
}
customOptions:{
isEdit:true,
isEditMode: true //Not mandatory but can be easier for documentation,
isNavigationOnSave: false //Can be different depending on what you want to do.
}
customOptions: {
isModelToLoad: false, // Model will be loaded by parent list view.
isEditMode: true, // Allow edit mode.
isNavigationOnSave: false,
isNavigationOnDelete: false,
isSaveOnServer: false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment