Troy Wolf
23 Aug 2007, 12:59 PM
This time around, I'm "simply" trying to understand Ext.View. What IS it? What does Ext mean by the term "view"?
I'm trying to derive the meaning from the API documentation along with forum searching, and so far I continue to be unclear on the subject. Take for example, this bit of code from the doc at http://extjs.com/deploy/ext/docs/output/Ext.View.html
var store = new Ext.data.Store(...);
var view = new Ext.View("my-element",
'<div id="{0}">{2} - {1}</div>', // auto create template
{
singleSelect: true,
selectedClass: "ydataview-selected",
store: store
});
// listen for node click?
view.on("click", function(vw, index, node, e){
alert('Node "' + node.id + '" at index: ' + index + " was clicked.");
});
// load XML data
dataModel.load("foobar.xml");
In particular, the 3rd line -- what does that second argument mean? What is this string:
'<div id="{0}">{2} - {1}</div>'
-----------------------------------------------------
A side note -- I have a feeling I'll learn to love the powerful functionality and elegance of Ext and become comfortable developing with it. If and when that happens, a paid support membership is an obvious choice. However, right now, I'm in a chicken & egg scenario. I cannot ask my employer to purchase support until I know if I want to use Ext. But without good support, it's hard to get to the point where I know how to use Ext.
Again, some kind of overview/architectural outline/terminology explanation would be helpful. (See http://extjs.com/forum/archive/index.php/t-9475.html)
I'm trying to derive the meaning from the API documentation along with forum searching, and so far I continue to be unclear on the subject. Take for example, this bit of code from the doc at http://extjs.com/deploy/ext/docs/output/Ext.View.html
var store = new Ext.data.Store(...);
var view = new Ext.View("my-element",
'<div id="{0}">{2} - {1}</div>', // auto create template
{
singleSelect: true,
selectedClass: "ydataview-selected",
store: store
});
// listen for node click?
view.on("click", function(vw, index, node, e){
alert('Node "' + node.id + '" at index: ' + index + " was clicked.");
});
// load XML data
dataModel.load("foobar.xml");
In particular, the 3rd line -- what does that second argument mean? What is this string:
'<div id="{0}">{2} - {1}</div>'
-----------------------------------------------------
A side note -- I have a feeling I'll learn to love the powerful functionality and elegance of Ext and become comfortable developing with it. If and when that happens, a paid support membership is an obvious choice. However, right now, I'm in a chicken & egg scenario. I cannot ask my employer to purchase support until I know if I want to use Ext. But without good support, it's hard to get to the point where I know how to use Ext.
Again, some kind of overview/architectural outline/terminology explanation would be helpful. (See http://extjs.com/forum/archive/index.php/t-9475.html)