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

  • Home
  • SEARCH
  • 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 9169971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:57:08+00:00 2026-06-17T15:57:08+00:00

Ext.define(Datetimepicker.view.Main, { extend: ‘Ext.form.Panel’, requires: [ ‘Ext.TitleBar’, ‘Ext.field.DatePicker’, ‘Ext.Spacer’, ‘Ext.Picker’ ], config: { fullscreen:’true’,

  • 0
    Ext.define("Datetimepicker.view.Main", {
               extend: 'Ext.form.Panel',
               requires: [
                                'Ext.TitleBar',
                                'Ext.field.DatePicker',
                                 'Ext.Spacer',
                                 'Ext.Picker'
                             ],
               config: {
                            fullscreen:'true',
                            title:'DatatimePicker',
                            items: [
                               {
                                   xtype:'fieldset',
                                        items:[
                                           {
                                              xtype:'datepickerfield',
                                              label:'Birthday',
                                              picker:{
                                                 yearFrom:1980,
                                                  yearTo:2015
                                               },
                                             name:'birthday',
                                             value:new Date()
                                         },
                                          {
                                            xtype:'textfield',
                                             label:'Time',
                                             value:''
                                           //In this textfield i want to display the time picker value
                                            }
                                        }
                                    ]
                                    },
                                 {

items:[
{
xtype:'spacer'
},
{
text: 'setValue',
handler: function() {
var datePickerField = Ext.ComponentQuery.query('datepickerfield')[0];
var randomNumber = function(from, to) {
return Math.floor(Math.random() * (to - from + 1) + from);
};
datePickerField.setValue({
month: randomNumber(0, 11),
day : randomNumber(0, 28),
year : randomNumber(1980, 2015)
});
}
},
{ xtype:'spacer'}
]
}
]
}
});

By using above code I’m getting the value of datepicker which successfully display in the first textfield.In the same way I want to display that value of datepicker in another textfield.
Can anyone help me to do this …thanks in advance

  • 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-17T15:57:09+00:00Added an answer on June 17, 2026 at 3:57 pm

    You can do it by setting the value of the textfield every time your picker's value has been changed so here is a solution:

     items: [
                {
                    xtype: 'datepickerfield',
                    label: 'Birthday',
                    name: 'birthday',
                    value: new Date(),
                    listeners: {
                        change: function(picker, value) {
                            // This function use to prepend 0 to the month which less than October
                            function minTwoDigits(n) {
                                return (n < 10 ? '0' : '') + n;
                            }
                            var date = value.getDate(), // Get date's value
                                month = value.getMonth(); // Get month's value
                            month += 1; // Increase the number of month by 1 since the index started with 0
                            var formatMonth = minTwoDigits(month),
                                year = value.getFullYear(), // Get year's value
                                formatDate = formatMonth.concat("/",date,"/",year); // Concatenate string
                            Ext.ComponentQuery.query('#textfield')[0].setValue(formatDate); // Set the value of the textfield with itemID equal to textfield
                        }
                    }
                },
                {
                    xtype:'textfield',
                    label:'time',
                    itemId: 'textfield',
                    value:''
    
                }
            ]
    

    If you don’t understand anything, feel free to ask. Hope it helps 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a FieldSet : Ext.define('admin.view.BuzzEditForm', { extend: 'Ext.form.Panel', requires: ['Ext.form.FieldSet','Ext.Img'], id: 'editorPanel', xtype:
I have a fieldset like this : Ext.define('admin.view.BuzzEditForm', { extend: 'Ext.form.Panel', requires: ['Ext.form.FieldSet','Ext.Img'], id:
Here is my MainView: Ext.define(Test.view.Main, { extend: 'Ext.Panel', config: { cls: 'transp' } });
I have a view designed like that: Ext.define('MY.view.NotificationMails', { extend: 'Ext.grid.Panel', alias: 'widget.NotificationMailsPanel', id:
I have grid something like this: Ext.define('Exp.view.dashboard.Tv', { extend: 'Ext.grid.Panel', initComponent: function() { this.columns
I'm using ExtJs4 and I'm trying to extend the Ext.form.field.ComboBox like below: Ext.define('GenericCombo', {
I have a grid panel like this Ext.define('sCon.view.SalesGrid',{ extend: 'Ext.grid.GridPanel', title: 'Sales Data', //other
I have done split view using 'hbox' layout, as below: Ext.define('Sencha.view.Blog', { extend: 'Ext.Panel',
ExtJS 4.1. Let's imagine we have some form: Ext.define('App.view.editform', { extend: 'Ext.form.Basic', defaultType: 'textfield',
I have created a view like this Ext.define('App.view.Message', { extend: 'Ext.Panel', alias: 'widget.message', config:

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.