PDA

View Full Version : dynamic variables and one more problem



kenny_mk
14 Oct 2010, 4:27 AM
good day

i have a grid with dynamic cols

(it works)

but i want a selectionmodel on this grid
and show all data in this grid.


my idea was:



sm: new Ext.grid.RowSelectionModel({
singleSelect: true,
listeners: {
rowselect: function(sm, row, rec) {
var recordType = ds.recordType;
var fields = recordType.prototype.fields;


for (var i = 0; i < fields.keys.length; i++)
{
var fieldName = fields.keys[i];
var field = recordType.getField(fieldName);
// field.name is the dataindex of the current col
var field_name=field.name;
if(i>5){
// rec.data is the data in the selected row but at .field_name rec.data look at a dataindex with this name...
alert(rec.data.field_name);
}


}



}
}
})
});




can me help someone?

thanks
greets kenny