Skip to content

Instantly share code, notes, and snippets.

@hapiben
Created March 15, 2012 05:29
Show Gist options
  • Save hapiben/2042157 to your computer and use it in GitHub Desktop.
Save hapiben/2042157 to your computer and use it in GitHub Desktop.
Secured ExtJS Components Implementation
/**
* Button - Normal instantiation
*/
var btn = new GepsRelease4AccessControlSecuredButton({
name: 'btn_Sample' // Required property.
,acp: 'Abstract' // Required property. (Access Rights Prefix)
,text: 'Sample'
,iconCls: 'icon-sample'
});
/**
* Button - Lazy instantiation
*/
config.items = [{
name: 'btn_Sample'
,xtype: 'securedbutton'
,acp: 'Abstract'
,text: 'Sample'
,iconCls: 'icon-sample'
}];
/*********************************** Form Components ***********************************/
/**
* Textfield - Normal instantiation
*/
var btn = new GepsRelease4AccessControlSecuredTextField({
name: 'FirstName' // Optional property. Required if your mapping this component to a object model
,sName: 'btn_FirstName' // Required property. sName stands for secured name
,acp: 'Abstract' // Required property. (Access Rights Prefix)
,text: 'Sample'
,iconCls: 'icon-sample'
});
/**
* Textfield - Lazy instantiation
*/
config.items = [{
name: 'FirstName'
,sName: 'btn_FirstName'
,xtype: 'securedtextfield'
,acp: 'Abstract'
,text: 'Sample'
,iconCls: 'icon-sample'
}];
/**
* The textfield code above also applies to all form components except button.
* The reason of having sName instead of name is because of the mapped object model.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment