-
11 Jan 2008 10:50 AM #1
row expander
row expander
I am using the nifty row-expander code from one of the demos.
1) Can a row expander have a renderer? In the source code for row-expander I see...
So seems like I should be able to update that? What I want to do is call a JSP page to render my HTML for me, and shove it in the box.PHP Code:renderer : function(v, p, record){
p.cellAttr = 'rowspan="2"';
return '<div class="x-grid3-row-expander"> </div>';
},
I am trying to do something like this
The doSomeCrap.do would call spring, do some java work, call a jsp, which would return some formated HTML.PHP Code:var expander = new xg.RowExpander({
renderer: renderExpander
})
renderExpander: function(v, p, record){
var html = "<br />";
var html += http://server-name.com/doSomeCrap.do;
return html
I realize that row-expander is usually preloaded content, am I going outside of the scope of this, and should just make a new class instead?
Also, wtf does the v, p, and record represent in the row expander? Record I can guess.. v and p not so easy.
-
11 Jan 2008 11:03 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
v = value
p = last column defined in the column model? <--- this is what i could tell.
Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
11 Jan 2008 11:07 AM #3
Is that how I replace the renderer class? Just declare a new one, and it will use that instead of the normal row expander one? /goes off to research inheritance in JS
-
11 Jan 2008 11:11 AM #4Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
yeah
Example:
PHP Code:function formatBox(_1, _2) {
if (_1 != _2) {
return (String.format('<span class="dnsAuditPreChange" style="text-decoration: line-through;">{0}</span> <hr style="height: 1px;" /><span style="font-weight: bold;">{1}</span>', _1, _2));
}
else {
return (String.format('<span class="dnsAuditPreChange">{0}</span> <hr /><span style="color: #000000">{1}</span>', _1, _2));
}
}
function renderHostnames(value, p, record){
return( formatBox(record.data['PRE_HOSTNAME'], record.data['POST_HOSTNAME']));
}

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
11 Jan 2008 11:26 AM #5
argh not even sure its the renderer I want to mess with, what I really need to do is change the template when I get an expand event.
Humm how to have the template loaded from a jsp instead of hard coded, that is the question..
-
11 Jan 2008 11:56 AM #6Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
You're going to have to return an iframe if you want to accomplish this.
or do an ajax call which gets can be hairy because of it being asynchronous
Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
11 Jan 2008 12:07 PM #7
-
11 Jan 2008 12:39 PM #8Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
welcome to web development, where not everything is as easy as you thinking it up.


Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.


Reply With Quote