javascript - Understanding ExtJS Framework Syntax -


i have been given project uses sencha's extjs framework, no handover or documentation. trying come grips hoping people can pls assist me following syntax possibly point me specific site might explain code newcomer framework.

i have been going through code , unsure doing, i.e.:

if(val==1) {         ext.getcmp('status').settext('awaiting approv');     }     switch(flag) {         case 1: if(val==0) {                     ext.getcmp('complex_first').el.replacecls('x-form-complex', 'x-form-simplex');                 } else {                     ext.getcmp('complex_first').el.replacecls('x-form-simplex', 'x-form-complex');                 }                 break;         case 2: if(val==0) {                     ext.getcmp('complex_second').el.replacecls('x-form-complex', 'x-form-simplex');                 } else {                     ext.getcmp('complex_second').el.replacecls('x-form-simplex', 'x-form-complex');                 }                 break;     default: break;     } 

now know jquery quite can used compare extjs following doing:

  1. ext.getcmp('status')
  2. ext.getcmp('complex_first').el.replacecls('x-form-complex', 'x-form-simplex');
  3. ext.getcmp('complex_first').el.replacecls('x-form-simplex', 'x-form-complex');

are these classes/div ids , in code or css files provide more info?

any great.

in ext js app, on page child of ext.component (grids, panels, form items, etc) gets registered static ext.componentmanager.

this provides simple way programatically retrieve references components , perform actions on them, without having run potentially complex dom queries.

ext.getcmp() alias of ext.componentmanager.get() , so, in example, ext.getcmp('status') retrieve component created id status. you'll able find reference in codebase.

a component, only after being rendered, gains ext.dom.element object, allowing interact dom element. can accessed via .getel() or, directly, .el property. element object provides additional methods interact dom, provide cross-browser compliance, etc. (broadly equivalent jquery element)

replacecls() swap or add classes in dom.

i recommend creating example application grasp of core ext js concepts before attempting decipher potentially complex codebase.


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -