SeaUrchinBot / closure-library

Automatically exported from code.google.com/p/closure-library
0 stars 0 forks source link

JsXmlHttpDataSource cannot be a childNode of another #483

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

I just want to know why JsXmlHttpDataSource cannot be a child of another 
dataSource.
JsXmlHttpDataSource's constructor does not accept opt_parent, so it will always 
be one of root node in DataManger. I want to prevent it because of namespace 
and change event handling issues.

        var dm = goog.ds.DataManager.getInstance();
        var parent = new goog.ds.FastDataNode({}, 'parentnode');
        dm.addDataSource(parent);
        dm.addListener(function (path) {
            console.log('changed', path)
        }, '$parentnode/...');

        var child = new goog.ds.JsXmlHttpDataSource('/rows?count=3', 'childnode');
        parent.add(child); // "changed $parentnode/childnode". This is fine.
        child.load();          // ...Nothing handled. Becuase child.getDataPath() is only 'childnode'.

I'm sure that JsXmlHttpDataSource can be a child when it accepts an argument. 
Or do I miss something?

Original issue reported on code.google.com by ThePigLo...@gmail.com on 15 Jul 2012 at 2:35