Link to home
Create AccountLog in
Avatar of Nigel-SA
Nigel-SA

asked on

Date issue field showing NaN/NaN/NaN


Got the code from http://cfsilence.com/blog/client/index.cfm/2008/4/7/CFGrid-Date-Picker-Editor
but I still can't get it working - driving me crazy

Using in a <cfgrid> the date picker works fine and the date is saved fine via the CFC.

When the page is refreshed "NaN/NaN/NaN" is displayed in the date column.

Any help will be greatly appreciated.


<script>
<!--- Date Picker--->
init = function(){
//grid object

grid = ColdFusion.Grid.getGridObject("SuperGrid");

//column model

cm = grid.getColumnModel();

//we need to know the column id

stIndex = cm.findColumnIndex("DATE_SITE_NOTIFIED");

var df = new Ext.grid.GridEditor(
   new Ext.form.DateField(
      {
         format: 'm/d/Y',
         minValue: '12/01/2004'
      }
   )
);


cm.setEditor(stIndex, df);
cm.setRenderer(stIndex, Ext.util.Format.dateRenderer('m/d/Y'));

grid.reconfigure(grid.getDataSource(),cm);
}

</script>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Anurag Agarwal
Anurag Agarwal
Flag of India image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Can you tell us what the answer was you found? I was sure the issue you were having was down to date format in JavaScript when I tested, are you sating this was not the case? If so, what was the soultion you found? I would be intrested to know.

Thanks