Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

ListGrid problems when column freezing and rowSpanning are set simultanoeusly

$
0
0
Hi isomorphic,

It seems like that ListGrid has some problems
when column freezing and rowSpanning are set simultaneously.

With the screen shot in the file attached,
you can see that records are not synchronized in the frozen and unfrozen areas.

Is this a bug or am I missing something ?
If this is a bug, will you please release a patch ASAP ?

Tests are done with
SmartClient LGPL Edition V9.1 (2014-07-06 nightly)
IE 10.0.17
Chrome 35.0.1916.153 m

Thanks.
Veritas

Code:

var data = [
                        { no: '1',  country: 'U.S.A',  city: 'Houston', product: 'A', desc: '1<br>2<br>3<br><a href="http://google.com" target="_blank">Google.com<a>', qty: '10', price: '', remark: 'Hot' },
                        { no: '2',  country: 'France',  city: 'Paris',  product: 'A', desc: '',            qty: '11', price: '', remark: 'Hot' },
                        { no: '3',  country: 'France',  city: 'Paris',  product: 'B', desc: '1<br>2<br>3', qty: '12', price: '', remark: 'Hot' },
                        { no: '4',  country: 'India',  city: 'Mumbai',  product: 'A', desc: '1<br>2<br>3', qty: '10', price: '', remark: 'Hot' },
                        { no: '5',  country: 'India',  city: 'Mumbai',  product: 'B', desc: '',            qty: '8',  price: '', remark: 'Hot' },
                        { no: '5',  country: 'India',  city: 'Delhi',  product: 'B', desc: '',            qty: '8',  price: '', remark: 'Hot' },
                        { no: '6',  country: 'England', city: 'London',  product: 'B', desc: '',            qty: '9',  price: '', remark: 'Hot' },
                        { no: '7',  country: 'Russia',  city: 'Moscow',  product: 'A', desc: '',            qty: '8',  price: '', remark: 'Hot' },
                        { no: '8',  country: 'Korea',  city: 'Gunpo',  product: 'A', desc: '',            qty: '12', price: '', remark: 'Hot' },
                        { no: '9',  country: 'Korea',  city: 'Seoul',  product: 'A', desc: '',            qty: '12', price: '', remark: 'Hot' },
                        { no: '10', country: 'Japan',  city: 'Tokyo',  product: 'C', desc: '',            qty: '6',  price: '', remark: 'Hot' },
                        { no: '11', country: 'Japan',  city: 'Tokyo',  product: 'C', desc: '',            qty: '8',  price: '', remark: 'Hot' }
          ];

var grid = isc.ListGrid.create({
autoDraw: false,
allowRowSpanning: true,
fixedRecordHeights:false,
top: 50,
left: 50,
width: 800,
height: 400,
fields:[
                  { width:  50, frozen: true, name: 'no',      title: 'No' },
                  { width: 100, frozen: true, name: 'country',  title: 'Country' },
                  { width: 100, frozen: true, name: 'city',    title: 'City' },
                  { width: 100, frozen: true, name: 'product',  title: 'Product' },
                  { width: 100, frozen: true, name: 'qty',      title: "Q'ty" },
                  { width: 200, name: 'desc',    title: 'Description' },
                  { width: 200, name: 'price',    title: "Price" },
                  { width: 200, name: 'remark',  title: "Remark" }
          ],
getRowSpan: function( record, rowNum, colNum ){
        var recCount = this.getTotalRows();
        if( rowNum >= recCount - 1 ){
                return 1;
        }

        var fName = this.getFieldName( colNum );
        if( fName != 'country' && fName != 'city' && fName != 'product' && fName != 'remark' ){
                return 1;
        }

        var rowSpan = 1;

        var nextRecord;
        for( var rowIndex = rowNum + 1; rowIndex < recCount; rowIndex ++ ){
                nextRecord = this.getRecord( rowIndex );
               
                if( record.country != nextRecord.country ){
                        break;
                }

                if( fName == 'country' ){
                        rowSpan ++;
                }
                else if( fName == 'city' ){
                        if( record.city != nextRecord.city ){
                                break;
                        }
                        rowSpan ++;
                }
                else if( fName == 'remark' ){
                        rowSpan ++;
                }
                else if( fName == 'product' ){
                        if( record.city != nextRecord.city || record.product != nextRecord.product ){
                                break;
                        }
                        rowSpan ++;
                }
        }
        return rowSpan;
}
});
grid.setData( data );
grid.show();


Attached Images
File Type: jpg listGrid.jpg (40.6 KB)

Viewing all articles
Browse latest Browse all 4756

Trending Articles