senchalabs/AppInspector — pull request #109 by stoe (2014-06-30 01:15:18+00:00)
Title: Ext JS 5 MVVM refactor

# Ext JS 5 MVVM refactor
This is a **beta**.
Some issues remain to be fixed.

## Modules
- [x] main
- [x] about
- [x] components
- [x] stores
- [x] layouts
- [x] events
- [x] mvc

## Known Issues
### Components
- MVVM ViewModel
```javascript
if (viewModel) {
boundData = viewModel.getData();

var recursiveFetchData = function(item, name) {
var node = Object.create(null), //which sets __proto__ to undefined
text = name || 'data',
children = [],
key;

// FIXME - recursion runs into an infinite loop crashing the devtools
return node;

/* ... */
};

data.mvvm.viewModel = Object.create(null); //which sets __proto__ to undefined
data.mvvm.viewModel.text = viewModel.$className;
data.mvvm.viewModel.value = viewModel.getId();
data.mvvm.viewModel.children = recursiveFetchData(boundData);
}
```
- MVVM ViewController *disabled*
```javascript
/*
if (viewController) {
data.mvvm.controller = Object.create(null); //which sets __proto__ to undefined
data.mvvm.controller.functions = [];

for (key in viewController) {
if (typeof viewController[key] === 'function') {
data.mvvm.controller.functions.push({
text: key,
leaf: true
});
}
}

data.mvvm.controller.className = viewController.$className;
data.mvvm.controller.id = viewController.getId();
}
*/
```

### Stores
- TreeStore inspection is currently turned off for inspected Ext JS 5 application.

### Layouts
- *Box Layouts* initial store load doesn't work properly. Store loads briefly and gets emptied again. Thus flickers.
- *Layout Runs* there are some issues within `AI.util.extjs.Events.recordEvents()` that interfere here, see [Events](#Events).

### Events
- Issues in `AI.util.extjs.Events.recordEvents()` that interfere w/ [Layouts](#Layouts). Seems like `Ext.ux.AppInspector.eventCaptureFn()` does not handle all possibilities (yet).