1. #1
    Ext User
    Join Date
    Dec 2007
    Posts
    110
    Vote Rating
    0
    tunaboo is on a distinguished road

      0  

    Default 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...

    PHP Code:
        renderer : function(vprecord){
            
    p.cellAttr 'rowspan="2"';
            return 
    '<div class="x-grid3-row-expander"> </div>';
        }, 
    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.


    I am trying to do something like this
    PHP Code:
        var expander = new xg.RowExpander({
            
    rendererrenderExpander
       
    })


    renderExpander: function(vprecord){
         var 
    html "<br />";
         var 
    html += http://server-name.com/doSomeCrap.do;
         
    return html 
    The doSomeCrap.do would call spring, do some java work, call a jsp, which would return some formated 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.

  2. #2
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,361
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    v = value
    p = last column defined in the column model? <--- this is what i could tell.

  3. #3
    Ext User
    Join Date
    Dec 2007
    Posts
    110
    Vote Rating
    0
    tunaboo is on a distinguished road

      0  

    Default


    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

  4. #4
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,361
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    yeah

    Example:
    PHP Code:
        function formatBox(_1_2) {
            if (
    _1 != _2) {
                return (
    String.format('<span class="dnsAuditPreChange" style="text-decoration: line-through;">{0}</span>&nbsp;<hr style="height: 1px;" /><span style="font-weight: bold;">{1}</span>'_1_2));
            }
            else {
                return (
    String.format('<span class="dnsAuditPreChange">{0}</span>&nbsp;<hr /><span style="color: #000000">{1}</span>'_1_2));
            }
        }
        function 
    renderHostnames(valueprecord){
        
            return( 
    formatBox(record.data['PRE_HOSTNAME'], record.data['POST_HOSTNAME']));
            
        } 

  5. #5
    Ext User
    Join Date
    Dec 2007
    Posts
    110
    Vote Rating
    0
    tunaboo is on a distinguished road

      0  

    Default


    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..

  6. #6
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,361
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    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

  7. #7
    Ext User
    Join Date
    Dec 2007
    Posts
    110
    Vote Rating
    0
    tunaboo is on a distinguished road

      0  

    Default


    ugh

  8. #8
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,361
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    welcome to web development, where not everything is as easy as you thinking it up.

Thread Participants: 1