PDA

View Full Version : use the cm.getDataIndex also for the first column



gisle
8 Mar 2007, 1:50 PM
cm.getDataIndex() might return 0 as a valid value.

Index: grid/GridView.js
===================================================================
--- grid/GridView.js (revision 3380)
+++ grid/GridView.js (working copy)
@@ -700,8 +700,12 @@
// build a map for all the columns
var cs = [];
for(var i = 0; i < colCount; i++){
+ var name = cm.getDataIndex(i);
+ if (name === undefined) {
+ name = ds.fields.get(i).name;
+ }
cs[i] = {
- name : cm.getDataIndex(i) || ds.fields.get(i).name,
+ name : name,
renderer : cm.getRenderer(i),
id : cm.getColumnId(i),
locked : cm.isLocked(i)

jack.slocum
11 Mar 2007, 1:02 AM
Thank you, should be fixed in next rev.