PDA

View Full Version : Ext.data.Record.create help..........



lincStar
30 Dec 2009, 12:26 AM
HI all,

I have use code as follows::


var record = Ext.data.Record.create([
{name: 'Id', mapping:'Id:nth(2)'},
{name: 'Name'},
{name: 'NumDayPresent'},
{name: 'NumDayAbsent'},
{name:'totalDay'}
]);

This is my record for Reader ...
can we add a fake column like percentPresent i.e.

{name:'percentPresent ' ,???}

what should i use so i can calculate it's percent presency???

My response is in XML......


Please Help ....
Waiting for Reply...........
Thanks,
LincStar

Condor
30 Dec 2009, 1:34 AM
You'll need to write a 'convert' function for the field.

Or you could use my Calculated fields (http://www.extjs.com/forum/showthread.php?t=28826) extension.

sanjaybh
29 Mar 2012, 10:33 PM
Hi Guys,

I have a problem, not sure how to resolve this. I have a editable grid, where in only one field is editable. but if i want to create a new record, all the fields should be editable.

var dataStoreModel = Ext.data.Record.create([{
name: 'productid',
type: 'int'
}, {
name: 'ratelookup',
type: 'int',
editor: {
xtype: 'numberfield',
allowBlank: false,
minValue: 1,
maxValue: 150000
}
},{
name: 'effective',
type: 'date',
dateFormat: 'm/d/Y'
},{
name: 'rateA',
type: 'float'
}]);

//under editable grid, in columns
columns : []

i have only rateA as the editable field in the grid, i want to have all the fields editable for "add" record and for update only RateA field


thanks,
SB