Ext.Window在extjs 3.4中显示当前打开窗口后面的方法打开窗口

时间:2016-02-18 12:43:08

标签: javascript extjs extjs4 extjs3

执行 window.show()方法后,我没有在当前窗口中显示新窗口。

当前窗口

的JS代码
popupWindowFileUpload = new Ext.Window({ 
    title : "Upload Files", 
    id : 'popupWindowFileUploadId', 
    layout:'fit', 
    width:470,
    height:250,
    draggable: false,
    modal:true,
    closeAction: 'close',
    plain: true,
    maximizable : true,
    minimizable : true,
    items:[pnlFileUpload]
});
popupWindowFileUpload.show();

这个的JS代码我试图从当前窗口打开另一个窗口。但它会在当前窗口后面打开。 :

$files = $_FILES;
        $cpt = count($_FILES['fl']['name']);
        if($cpt<=10)
        {
            $number_of_files = sizeof($_FILES['fl']['tmp_name']);
            $files = $_FILES['fl'];
            $errors = array();

            for($i=0;$i<$number_of_files;$i++)
            {
                if($_FILES['fl']['error'][$i] != 0) $errors[$i][] = 'Couldn\'t upload file '.$_FILES['fl']['name'][$i];
            }
                if(sizeof($errors)==0)
                {
                    $this->load->library('upload');
                    $config['upload_path'] = FCPATH . './assets/upload/multiple/';
                    $config['allowed_types'] = 'gif|jpg|png|jpeg';
                    for ($i = 0; $i < $number_of_files; $i++) {
                        //$_FILES['uploadedimage']['ext'] = $this->get_extension($files['name'][$i]);
                        //echo $_FILES['uploadedimage']['ext'];

                        $_FILES['uploadedimage']['name'] = time().$i.$files['name'][$i];
                        $_FILES['uploadedimage']['type'] = $files['type'][$i];
                        $_FILES['uploadedimage']['tmp_name'] = $files['tmp_name'][$i];
                        $_FILES['uploadedimage']['error'] = $files['error'][$i];
                        $_FILES['uploadedimage']['size'] = $files['size'][$i];
                    $fileName[] = $_FILES['uploadedimage']['name'];

                    $this->upload->initialize($config);
                    if ($this->upload->do_upload('uploadedimage'))
                    {
                        $data['uploads'][$i] = $this->upload->data();
                    }
                    else
                    {
                        $data['upload_errors'][$i] = $this->upload->display_errors();
                }
            }
        }
    $fname=implode(",",$fileName);

注意:关闭当前窗口后我可以看到该窗口。 如果你知道与这个问题有关的事情,请告诉我,我做错了吗?

1 个答案:

答案 0 :(得分:1)

您应该调用toFront()窗口方法

popupWindowFileUpload.show();
popupWindowFileUpload.toFront();