Jump to content

how to span a rows base on a Column Data?


molla2005b

Recommended Posts

On 3/23/2022 at 3:09 AM, Sherzod said:
colIndx = 1; // second column for example
            column = columns[colIndx],
            dataIndex = column.dataIndex,
            
            spanCell = null,
            spanCount = null;
            spanValue = null;
        
        for (var row = 0; row < rowCount; ++row) {
            var cell = view.getCellByPosition({ row: row, column: colIndx }).dom,
                record = store.getAt(row),
                value = record.get(dataIndex);
            
            if (spanValue != value) {
                if (spanCell !== null) {
                    spanCell.rowSpan = spanCount;
                }
                
                //Ext.fly(cell).setStyle('display', '');
                Ext.fly(cell).query('.x-grid-cell-inner')[0].style.display='';
                spanCell = cell;
                spanCount = 1;
                spanValue = value;
            } else {
                spanCount++;
                //Ext.fly(cell).setStyle('display', 'none');
                Ext.fly(cell).query('.x-grid-cell-inner')[0].style.display='none';
            }
        }
        
        if (spanCell !== null) {
            spanCell.rowSpan = spanCount;
        }

You can repeat this part several times inside the function by specifying different indexes colIndx = xx

  • Thanks 1
Link to comment
Share on other sites

  • 1 year later...
On 4/8/2022 at 9:36 PM, Sherzod said:

You can repeat this part several times inside the function by specifying different indexes colIndx = xx

Hi @Sherzod!

 

Can I center vertically the value of merged Cells? If so, how to do this?

 

TIA

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...