Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8886913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:40:30+00:00 2026-06-14T21:40:30+00:00

I am using extjs 4.1 .I have a grid that is showing date in

  • 0

I am using extjs 4.1 .I have a grid that is showing date in desired time format. But when I want to show the date and intime and outtime in a window for edit then only date is displaying. but intime and outtime is not displaying. All the fields in database are datetime. Can anyone please help me on this. Here is my code below :

my grid is like below :

Ext.define('Ext4Example.view.attendence.Datagrid' ,{
    extend: 'Ext.grid.Panel',
    alias : 'widget.datagrid',
    layout: 'fit',
    border: true,
    viewConfig: {
        stripeRows: true,
        forceFit:true,
        emptyText:'No Records to display'
    },

    hideHeaders: false,
    initComponent: function() {

        this.store = 'Attendences';
        //this.width = 400;      
        this.columns = [
        {
            text: 'Date',
            dataIndex: 'id',
            renderer: function(value, metaData){
                return Ext.Date.format(value, 'M d, Y');
            }
        },{
            text: 'Day',
            dataIndex : 'id',
            renderer: function(value, metaData){
                return Ext.Date.format(value, ' l');
            }
        },
        {
            text: 'In-Time',
            dataIndex: 'intime',
            renderer: function(value, metaData){
                return Ext.Date.format(value, 'h:i A');
            }
        },
        {
            text: 'Out-Time',
            dataIndex: 'outtime',
            renderer: function(value, metaData){
                return Ext.Date.format(value, 'h:i A');
            }
        }


        ];

        this.callParent(arguments);
    }
});

And the window is given below where i want the values for edit :

    Ext.define('Ext4Example.view.attendence.Editattendence' ,{
    extend: 'Ext.window.Window',
    alias : 'widget.editattendence',
    title: 'Edit Attendence',
    layout: 'fit',
    autoShow: true,
    initComponent: function () {
        this.items = [
        {
            xtype: 'form',

            bodyStyle: {
                background: 'none',
                padding: '10px',
                border: '0'
            },
            items: [
            {
                xtype: 'datefield',
                name: 'id',
                allowBlank: false,
                fieldLabel: 'Attendene ID'
            },
            {
                xtype: 'numberfield',
                name: 'intime',
                allowBlank: false,
                fieldLabel: 'IN TIME',
                renderer: function(value, metaData){
                return Ext.Date.format(value, 'h:i A');
            }
            },{
                xtype: 'numberfield',
                fieldLabel: 'OUT TIME',
                name: 'outtime',
                renderer: function(value, metaData){
                return Ext.Date.format(value, 'h:i A');
            }
            }
            ]
        }
        ];
        this.buttons = [
        {
            text: 'Save',
            action: 'save'
        },
        {
            text: 'Cancel',
            scope: this,
            handler: this.close
        }
        ];
        this.callParent(arguments);
    }
});

And the controller where I am calling this window on double click in grid row is given below :

Ext.define('Ext4Example.controller.Attendences', {
    extend: 'Ext.app.Controller',
    stores: [
    'Attendences','Months'
    ],
    models: [
    'Attendence','Month'
    ],
    views: [
    'attendence.Timeperiod','attendence.Details','attendence.Attendencewindow','attendence.Editattendence','attendence.Datagrid'  //'attendence.Months'
    ],

    refs: [{
        ref: 'stockaddForm',
        selector: 'form'
    }],

    init: function () {
        this.control({
            'datagrid': {
                itemdblclick: this.editUser,
                viewready: this.attnready
            },
            'attendencewindow button[action=save]': {
                click: this.save
            }       
        });
    },

    editUser: function(grid, record){
        var view = Ext.widget('editattendence');
        view.down('form').loadRecord(record);
    },
    save: function(){
        var today = new Date();
        var dd = today.getDate();
        var mm = today.getMonth()+1; //January is 0!
        var yyyy = today.getFullYear();     //+1
        Ext.Msg.alert("Today is - ",dd+" - "+mm+" - "+yyyy);
    },
    attnready: function(grid, eOpts) {       
        console.log('hello');
        var store = grid.getStore(),
        selModel = grid.getSelectionModel();
          if (store.getAt(0)) {
            selModel.select(0);
        }
    }
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T21:40:32+00:00Added an answer on June 14, 2026 at 9:40 pm

    Hey I have solve this problem. Just a little bit of change in the editAttendence form as follows :

    Ext.define('Ext4Example.view.attendence.Editattendence' ,{
        extend: 'Ext.window.Window',
        alias : 'widget.editattendence',
        title: 'Edit Attendence',
        layout: 'fit',
        autoShow: true,
        initComponent: function () {
            this.items = [
            {
                xtype: 'form',
    
                bodyStyle: {
                    background: 'none',
                    padding: '10px',
                    border: '0'
                },
                items: [
                {
                    xtype: 'datefield',
                    name: 'id',
                    allowBlank: false,
                    fieldLabel: 'Attendene ID'
                },
                {
                    xtype: 'datefield',
                    format:'h:i A',
                    name: 'intime',
                    allowBlank: false,
                    fieldLabel: 'IN TIME'
    
                },{
                    xtype: 'datefield',
                    format:'h:i A',
                    fieldLabel: 'OUT TIME',
                    allowBlank: false,
                    name: 'outtime'
    
                }
                ]
            }
            ];
            this.buttons = [
            {
                text: 'Save',
                action: 'save'
            },
            {
                text: 'Cancel',
                scope: this,
                handler: this.close
            }
            ];
            this.callParent(arguments);
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with a Ext.Grid.EditorGridPanel, I am currently using ExtJS 2.3.0, that
I have created one editor grid panel using extjs in that grid panel by
I am using ExtJS (v3) and I have a form built that I want
I am using the ExtJS framework and I have the following handler that is
I have the following extjs code that createa 2 tabs and a grid. How
I am using extjs grid, and I have a jQuery timer, which will call
I am using ExtJs 4.1 framework. I have a grid which shows only one
I have ExtJS Grid. And I am using Roweditor plugin with combobox. When I
I have an EXTJS paging grid with checkbox selection model. I want to know
I am using ExtJS 4.1. I want to capture the time required to load

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.