View Full Version : How to initially sort columns when using Ext.ux.grid.TransformGrid

4 Nov 2012, 3:38 PM
I use Ext.ux.grid.TransformGrid to create a grid, referencing a table in the HTML code:

var grid2 = Ext.create('Ext.ux.grid.TransformGrid', 'msgTable', {
title: 'Message Summary',
stripeRows: true,
height: 130

and the table (snippet from HTML code):

<table hidden id="msgTable" class="x-hidden">
<col id="code"> <col id="count"> <col id="error"> <col id="warn">

In my code, grid2 is added to an Ext.Panel, etc.

The table renders fine and the manual sort controls work fine, too.
However, I would like the table to be initially sorted in DESC order by 'warn' then by DESC order by 'error'.

I looked through many examples, but did not find any which showed how to initial sorting; esp. when using a TransformGrid to create the grid.

6 Nov 2012, 5:23 AM
It will keep the sorting for what you have in your html. You can extend TransformGrid and in the constructor after the callParent call you can then sort the store which will happen before the grid is rendered.