extjs - How to add custom code on the click of Today button with xtype: 'datefield' -


How to add custom code to the click of a button with xtype: 'Datefield'

For example : Adding a custom date after clicking on "Today" button

  Ext.create ('Ext.form.Panel', {rendersTo: Ext.getBody (), width: 300, bodypadding: 10, Title: 'Dates', items: [[xtype: 'Datefield', Anchor: '100%', field label: 'to', name: 'from_date', maximum value: new date () // current date or Limited to the east;]}}); As  

As @ A RR pin states, there is an implementation here which gets the button from the picker.

  var picker = Ext.create ('Ext.form.field.Date', {anchor: '100%', field label: 'to', name: 'from_date', maxValue: New date ()}); Var Field = Ext.create ('Ext.form.Panel', {rendersTo: Ext.getBody (), Width: 400, Height: 400, Title: 'Dates', Item: [Picker]}); Picker.getPicker () TodayBtn.on ('click', function () {warning ('hello');});    

Comments

Popular posts from this blog

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -