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

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -