1. #1
    Ext User
    Join Date
    Sep 2008
    Posts
    7
    Vote Rating
    0
    saipkjai is on a distinguished road

      0  

    Default GridView date and date store Date

    GridView date and date store Date


    Hi

    Right now, I was trying to retrieve some date from server side and paste it onto the editor grid. But somehow, the value it display at at the editor grid is wrong compare to the value I pass back from the datebase and from checking datestore using firebug.

    eg: if I pass back "31/07/2007" (as a string) back from the database, the extjs gets it, and "07/07/2009" would be displayed on the editor grid panel

    Following are the store, colulmn model and grid.
    Code:
    
        //       // create the Data Store
        var OtSuiteMainStore = new Ext.data.Store({
            url : '../getotsuitemain',
            baseParams : {
                'action' : 'getOtSuiteMain'
            },
            reader : new Ext.data.XmlReader({
                record : 'Row'
            }, [
            "effective_dte"
            ])
    
        });
        OtSuiteMainStore.load();
        
        
        
        var OtSuiteEffDateField = new Ext.form.DateField({
            id:'OtSuiteEffectiveDate',
            format: "d/m/Y",
            renderer: Ext.util.Format.dateRenderer("d/m/Y")
        });
        
        
        
        var OtSuiteCol = new Ext.grid.ColumnModel([{
    
                id: "OtSuiteEffDateId",
                header: 'Effect Date',
                dataIndex: 'effective_dte',
                width: 95,
                format: "d/m/Y",
                renderer: Ext.util.Format.dateRenderer("d/m/Y"),            
                editor: OtSuiteEffDateField
        }]);
    I have been banning my head onto the wall for this for the last 24 hours already...can anyone point me to the right direction...what's wrong with this?

  2. #2
    Ext User
    Join Date
    Sep 2008
    Posts
    7
    Vote Rating
    0
    saipkjai is on a distinguished road

      0  

    Default


    problem solved...but adding type and dateFormat to the dateStore.

    {name:"close_dte", type: 'date', dateFormat: 'd/m/Y'}