javajunky
17 Jan 2007, 2:42 PM
I'm sorry for yet another daft post, aI missing a really obvious way to mark JsonViews as 'auto-refresh'. I can't seem to spot a config parameter for it, nor can I see from the docs a way to get hold of an associated UpdateManager for the object (is there one? )
Just for reference the code I'm using for the initial display of the json-view is as follows:
var view = new YAHOO.ext.JsonView('Container', '<div>{foo} - {bar}</div>', { multiSelect: true, jsonRoot: 'data' });
view.load('data.html');
Where data.html contains:
{"data":[{"foo":"poo","bar":"poop"}, {"foo":"boo","bar":"boop"}]}
Now this works perfectl and my template is rendered, bonus :) But now I'd like to change it so if data.html is changed, then the rendered view would automatically change to represent it . Am I approaching this correctly ? Would I be better off using a raw UpdateManager, and returning the pre-rendered divs , rather than the JSON?
Sorry if this is stupid!
Just for reference the code I'm using for the initial display of the json-view is as follows:
var view = new YAHOO.ext.JsonView('Container', '<div>{foo} - {bar}</div>', { multiSelect: true, jsonRoot: 'data' });
view.load('data.html');
Where data.html contains:
{"data":[{"foo":"poo","bar":"poop"}, {"foo":"boo","bar":"boop"}]}
Now this works perfectl and my template is rendered, bonus :) But now I'd like to change it so if data.html is changed, then the rendered view would automatically change to represent it . Am I approaching this correctly ? Would I be better off using a raw UpdateManager, and returning the pre-rendered divs , rather than the JSON?
Sorry if this is stupid!