Results 1 to 2 of 2

Thread: How to create the table with two headers levels

  1. #1
    Sencha User
    Join Date
    Mar 2010
    Location
    Russia, Moscow
    Posts
    60

    Default How to create the table with two headers levels

    Help to create the table.

    I want to create the table in which there will be two lines of headers that it was possible to sort on each column.

    I tried to make so:

    Code:
    columns: [
        {text: 'ID', hidden: true, width: 50, sortable: true, dataIndex: 'id', renderer: function(v, meta, rec) {return rec.phantom ? '' : v;}, filter: {type: 'number'}}, 
        {
            text: 'num order', 
            flex: 1, 
            sortable: true, 
            dataIndex: 'name', 
            filter: {type: 'string'},
            layout: 'hbox',
            renderer: function(v, m, rec) {
              return rec.data.name + '<br>' + rec.data.test1;
            },
            items: {
                text: 'test1', 
                flex: 1, 
                dataIndex: 'test1', 
                xtype: 'gridcolumn', 
                sortable: true, 
                filter: {type: 'string'}
            },                 
        }, {
            text: 'test', 
            flex: 1, 
            sortable: true, 
            dataIndex: 'test', 
            filter: {type: 'string'},
            layout: 'hbox',
            renderer: function(v, m, rec) {
              return rec.data.test + '<br>' + rec.data.test2;
            },
            items: {
                text: 'test2', 
                flex: 1, 
                dataIndex: 'test2', 
                xtype: 'datecolumn', 
                sortable: true, 
                filter: {type: 'string'}
            },                 
        },                        
    ]
    But works so not absolutely correctly, when clicking a column the icon of sorting appears directly over two columns, perhaps there is some other method?

    table.jpg

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890
    Answers
    41

    Default

    Unusual use case. You could try a custom sorter on each column.

    https://docs.sencha.com/extjs/6.2.0/...tml#cfg-sorter

    Unfortunately, Idera have let some SSL certs expire, so I can't take a look on Fiddle.

Similar Threads

  1. Replies: 1
    Last Post: 21 Apr 2015, 9:47 AM
  2. Replies: 6
    Last Post: 9 Oct 2013, 6:57 AM
  3. Replies: 1
    Last Post: 22 Nov 2012, 8:15 PM
  4. Bad rendering of table headers
    By zeroed in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 2 Oct 2008, 6:27 AM
  5. Table Column Headers
    By jerryc57 in forum Ext GWT: Help & Discussion (1.x)
    Replies: 5
    Last Post: 26 May 2008, 10:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •