0

I am trying to convert my application from 3.1 to 4.2 and can't seem to figure out what needs to be modified in place of the 'applyto'. I have tried variations of renderto and contentel but can't seem to figure it out. With 4.2 nothing seems to happen. No errors in firebug...

Ext 3.1 code that works

 cust_datepicker = function(){
     var els=Ext.select("input.date-picker",true);
     els.each(function(el) {
         new Ext.form.DateField({
             applyto: el.id
             ,format: 'Y-m-d'
             ,altFormats: 'j|j/n|j/n/y|j/n/Y|j-M|j-M-y|j-M-Y'
             ,editable: false
             ,id : el.id
         });
     }
 )};
 Ext.onReady(function(){
     cust_datepicker();
 });

HTML Code:

<form action="xxx/xxx.cgi" method="GET">
<table><tr>
<td><input name="startdate" class="date-picker"/></td>
</tr></table>
</form>
1
  • was the answer below helpful?
    – dbrin
    May 9, 2013 at 20:50

2 Answers 2

0

Here something that worked for me with ExtJS 4.2.0.

The solution is to create a Form containing a Field.

HTML :

<table>
  <tr>
    <td><div id="here"></div></td>
  </tr>
</table>

Javascript:

var here = document.getElementById('here');
var my_form = Ext.create('Ext.form.Panel', {
        renderTo: here,
        width: 100,
        bodyStyle: 'border: none; padding: 0px',
        items: [{
            xtype: 'datefield',
            fieldStyle: 'width: 76px;',
            margin: false
        }]
    });
-1

Try using contentEl property:

http://docs.sencha.com/ext-js/4-1/#!/api/Ext.AbstractComponent-cfg-contentEl

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.