Results 1 to 5 of 5

Thread: Ext.FormPanel.Add - Object required in IE

  1. #1

    Default Answered: Ext.FormPanel.Add - Object required in IE

    I want to create block for adding unlimited number of files to the form. I wanted to do it with Ext.FormPanel.

    I do:
    var file_new=new Object(new Ext.form.File({
    "fieldLabel": '????',
    "name": 'file_'+frm.files_num,
    "xtype": 'filefield',
    "afterSubTpl": '<a title="??????? ???? ????" class="linkclass'+frm.files_num+'" id="'+frm.files_num+'" >X</a>'

    }));
    Ext.getCmp('simpleForm').add(file_new);



    And it works ok in all browsers but IE write error "Object required". You can see it on my test page: http://bstocks.moscower.com/test.htm

    How I can resolve this issue? Please help!

    Thank you.


  2. The following code works fine for me on IE 9, Ext 4.1.0 and Ext 4.1.1:
    Code:
    Ext.onReady(function(){
        var form = Ext.create('Ext.form.Panel', {
            renderTo: Ext.getBody(),
            width: 400,
            height: 200
        });
        form.add({
            "fieldLabel": 'File',
            "name": 'file_1',
            "xtype": 'filefield',
            "afterSubTpl": '<a title="Delete file" class="linkclass1" id="1" >X</a>' 
        });
    });

  3. #2
    Sencha User
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    347

    Default

    Try to modify your code as below:
    Code:
    //var file_new = new Object(new Ext.form.File({
    var file_new = new Ext.form.File({   // or Ext.create('Ext.form.File', {
        "fieldLabel": '????',
        "name": 'file_'+frm.files_num,
        "xtype": 'filefield',
        "afterSubTpl": '<a title="??????? ???? ????" class="linkclass'+frm.files_num+'" id="'+frm.files_num+'" >X</a>' 
    });
    Ext.getCmp('simpleForm').add(file_new);

  4. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    2

    Default

    Tried these options, including:

    Ext.getCmp('simpleForm').add({
    "fieldLabel": 'File',
    "name": 'file_'+frm.files_num,
    "xtype": 'filefield',
    "afterSubTpl": '<a title="Delete file" class="linkclass'+frm.files_num+'" id="'+frm.files_num+'" >X</a>'
    });

    All options work in other browsers except IE.

    Error in IE:

    Message: Object required
    Line: 21
    Symbol: 137225
    Code: 0
    URI: ext-all.js

    used version Ext 4.1.0

    Problem this function:

    ieTable:function(v,q,w,u){
    p.innerHTML=[q,w,u].join("");
    var r=-1,t=p,s;
    while(++r<v){
    t=t.firstChild
    }
    s=t.nextSibling; // here error
    if(s){
    t=document.createDocumentFragment();
    while(s){
    t.appendChild(s);
    s=s.nextSibling
    }
    }
    return t
    }

  5. #4
    Sencha User
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    347

    Default

    The following code works fine for me on IE 9, Ext 4.1.0 and Ext 4.1.1:
    Code:
    Ext.onReady(function(){
        var form = Ext.create('Ext.form.Panel', {
            renderTo: Ext.getBody(),
            width: 400,
            height: 200
        });
        form.add({
            "fieldLabel": 'File',
            "name": 'file_1',
            "xtype": 'filefield',
            "afterSubTpl": '<a title="Delete file" class="linkclass1" id="1" >X</a>' 
        });
    });

  6. #5
    Sencha User
    Join Date
    Oct 2012
    Posts
    2

    Default

    Quote Originally Posted by vietits View Post
    The following code works fine for me on IE 9, Ext 4.1.0 and Ext 4.1.1:
    Code:
    Ext.onReady(function(){
        var form = Ext.create('Ext.form.Panel', {
            renderTo: Ext.getBody(),
            width: 400,
            height: 200
        });
        form.add({
            "fieldLabel": 'File',
            "name": 'file_1',
            "xtype": 'filefield',
            "afterSubTpl": '<a title="Delete file" class="linkclass1" id="1" >X</a>' 
        });
    });
    Thank you, for your answer.

    I fix error remove "layout: 'form'".

    Add to your form this: layout: 'form'
    var form = Ext.create('Ext.form.Panel', {
    layout: 'form',
    renderTo: Ext.getBody(),
    width: 400,
    height: 200
    });

    And test in IE.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •