Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8243483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:32:13+00:00 2026-06-07T21:32:13+00:00

Is it possible to merge 2 columns in TreeGrid, when one of them is

  • 0

Is it possible to merge 2 columns in TreeGrid, when one of them is xtype ‘treecolumn’?

For now I have 2 separate columns, one is standard treecolumn, second is templatecolumn with custom template (basically an image)

now it looks like this

What I would like to get should look like this:

what I'm trying to do

So that second column content is added to first but aligned to right.

I have no idea how to even start with that kind of renderer 🙁

This is code for my columns so far:

{
    xtype : 'treecolumn',
    text : 'Dział/Pracownik',
    width : 200,
    sortable : true,
    hideable: false,
    dataIndex : 'Name',
    renderer: function (v, m, r) {
        if(r.get('leaf')==true)
            m.tdAttr = 'data-qtip="<img src=services/Images.ashx?login='+r.get('login')+' width=60px height=60px>"';
            return v;
    }
},
{
    text : 'Zdj', 
    width: 40, 
    align : 'center', 
    dataIndex : 'Name', 
    sortable : false, 
    resizable: false,
    xtype : 'templatecolumn', 
    tpl : imgTpl
},
...
var imgTpl = Ext.create('Ext.XTemplate',
    '<tpl for=".">',
        '<tpl if="values.leaf == true">',
        '<img src="services/Images.ashx?login={login}" width="25px" height="25px"/>',
    '</tpl>',
    '</tpl>'
);

I will really be gratefully for any hints on how to merge those 2 columns.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T21:32:14+00:00Added an answer on June 7, 2026 at 9:32 pm

    What I have done is instead using template I’ve used renderer, so my column now looks like this:

    {
        xtype : 'treecolumn',
        text : 'Employee',
        width : 200,
        sortable : true,
        hideable : false,
        dataIndex : 'Name',
        renderer : function(v, m, r) {
            if (r.get('leaf')) {
                return '<div style="float: left">'
                + r.get('Name')
                + '</div><img data-qtip="<img src=services/Images.ashx?login='
                + r.get('login')
                + ' width=60px height=60px/>" src="services/Images.ashx?login='
                + r.get('login')
                + '" width="25px" height="25px" style="float: right; margin-right: 5px"/>';
            }
    
        return '<div style="float: left">' + r.get('Name') + '</div>';
        }
    }
    

    If element is leaf then I display extra image in the right of my column + I’ve added bigger image after rollover.

    To have this working I had to change some css inside ext-all.css:

    .x-grid-with-row-lines .x-tree-icon{margin-top:1px; float: left}
    .x-grid-with-row-lines .x-tree-elbow,.x-grid-with-row-lines .x-tree-elbow-end,.x-grid-with-row-lines .x-tree-elbow-plus,.x-grid-with-row-lines .x-tree-elbow-end-plus,.x-grid-with-row-lines .x-tree-elbow-empty,.x-grid-with-row-lines .x-tree-elbow-line{height:19px;background-position:0 -1px; float: left}

    I had to add float:left to all images that are displayed in that cell:

    • x-tree-elbow
    • x-tree-elbow-end
    • x-tree-elbow-plus
    • x-tree-icon

    I know that this can be optimised a lot, but for me it works fine. If some ExtJS guru could tweak it to work better then you’re welcome 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to merge a range of revisions from one branch to another
How could I merge these into one line? I'm sure it's possible. RewriteRule ^forums$
I have a merge statement that needs to compare on many columns. The source
Possible Duplicate: MySQL: FULL OUTER JOIN - How do I merge one column? Real
Possible Duplicate: Merge two rows in SQL I have the following values in table:
Is it possible to group rows with columns and have the remaining data merged
Is it possible to merge elements using XSLT. If I have the following XML
Is it possible to merge Google Fusion Tables using GQL or other Javascript/REST API?
Is it possible to merge changes from a central repo to a local branch
Is it possible to merge two JSON documents with the Jackson JSON library? I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.