Roo.util.Observable
Roo.View
Roo.JsonView 

		   

Class Roo.JsonView

Package:Roo
Defined In: Roo/JsonView.js.
Class:JsonView
Extends: Roo.View
Shortcut class to create a JSON + {link Roo.UpdateManager} template view. Usage:

var view = new Roo.JsonView({
container: "my-element",
tpl: '<div id="{id}">{foo} - {bar}</div>', // auto create template
multiSelect: true,
jsonRoot: "data"
});

// listen for node click?
view.on("click", function(vw, index, node, e){
alert('Node "' + node.id + '" at index: ' + index + " was clicked.");
});

// direct load of JSON data
view.load("foobar.php");

// Example from my blog list
var tpl = new Roo.Template(
'<div class="entry">' +
'<a class="entry-title" href="{link}">{title}</a>' +
"<h4>{date} by {author} | {comments} Comments</h4>{description}" +
"</div><hr />"
);

var moreView = new Roo.JsonView({
container : "entry-list",
template : tpl,
jsonRoot: "posts"
});
moreView.on("beforerender", this.sortEntries, this);
moreView.load({
url: "/blog/get-posts.php",
params: "allposts=true",
text: "Loading Blog Entries..."
});


Note: old code is supported with arguments : (container, template, config)
Class Comments / Notes => [Add Your comment/notes about this class]
Config Options (Usually are also Properties)
Options Defined By
Public Properties - Has None
Public Methods
Method Defined By
Events
Event Defined By
Documentation generated by Introspection Doc Generator on Fri Jul 13 2018 14:10:53 GMT+0800 (HKT) Based on JsDoc Toolkit