View Full Version : To a Store how to add a new Field to it with the Field already present ?

20 Jul 2012, 3:11 AM
I have a Store. And 5 fields are there. From one of a field(having timestamp value) I want create a new Field which is of type Date type. How can this be Done ? Thanks.

20 Jul 2012, 3:47 AM
take a look at:

20 Jul 2012, 6:00 AM
Thanks for replying. I will take a look.

20 Jul 2012, 6:41 AM
I tried with as above mentioned and I was not able to get it,

function convertfromDate(v, record)
var tstamp = record.day;
console.log(tstamp); //This was printing undefined
var dd = new Date(tstamp * 1000);
return dd;

And this is the store excerpt

{name:'day', type:'int'}, // this has some value like 1342160000
{name:'fromDate', convert:convertfromDate},

Please help !

20 Jul 2012, 7:25 AM
Try changing var tstamp = record.day; to var tstamp = record.get('day');

22 Jul 2012, 7:50 PM
Thanks droessner, tobiu . It helped me a lot. :)