at()
in params
(1st parameter of widget) is not effective for widgets with dojox/mvc/_Controller mixed in. For example, console output of below code shows undefined
while it should show "Foo":
<html>
<head>
<title>None</title>
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.9.0/dojo/dojo.js" type="text/javascript" data-dojo-config="parseOnLoad: 0, async: 1"></script>
<script type="text/javascript">
require([
"dojo/_base/declare",
"dojo/Stateful",
"dijit/_WidgetBase",
"dojox/mvc/_Controller",
"dojox/mvc/at",
"dojo/domReady!"
], function(declare, Stateful, _WidgetBase, _Controller, at){
var model = new Stateful(),
w = new (declare([_WidgetBase, _Controller], {}))({
foo: at(model, "foo")
});
w.startup();
model.set("foo", "Foo");
console.log(w.get("foo")); // Should show "Foo", but shows undefined
});
</script>
</head>
<body></body>
</html>
Fix in: https://github.com/dojo/dojox/pull/38