PDA

View Full Version : Jsonview probleme



alex1er
14 Jan 2007, 8:40 AM
Hello

I have a json object which it is not obtain by a request on php page.

Instead of do a view.load, i'de like to push the jsondata directly to the jsonview.

how can i do?

There my code



var config = {root:{ label:'pays', input:{type:'text', id:'unId'} } };
var view = new YAHOO.ext.JsonView( dialog.body.dom,
'<div ">{label}</div>',
{ multiSelect: true, jsonRoot: 'root' });
view.jsonData = config;
view.refresh();



thanks

tryanDLS
14 Jan 2007, 10:15 AM
Look at the doc for the loadData fn in LoadableDataModel. This takes a data object as a first arg, instead of a url.

alex1er
14 Jan 2007, 11:27 PM
Ok Tim.

But in which package can i find 'LoadableDataModel' because, in the doc, i don't.

thanks

tryanDLS
15 Jan 2007, 7:08 AM
Go back and look at the doc.
http://yui-ext.com/deploy/yui-ext/docs/output/YAHOO.ext.grid.LoadableDataModel.html

jack.slocum
15 Jan 2007, 7:38 AM
jsonData should be an array.