English 中文(简体)
在现有窗口中添加一个项目
原标题:Adding an item to an existent window
  • 时间:2010-05-23 23:09:29
  •  标签:
  • extjs

怎么能够把一个物品添加到现有的窗口中? 我尝试了胜诉,但似乎并不奏效。 为什么? 这是我的法典:

function combo_service(winTitle,desc,input_param) {

        /* parametri */
        param=input_param.split(","); /* della forma: param[0]="doc1:text", quindi da splittare di nuovo */

   /* cosi  non la creo più volte */
   win;

   if (!win)
    var win = new Ext.Window({
         //title:Ext.get( page-title ).dom.innerHTML
        renderTo:Ext.getBody()
        ,iconCls: icon-bulb 
        ,width:420
        ,height:240
        ,title:winTitle
        ,border:false
        ,layout: fit 
        ,items:[{
            // form as the only item in window
             xtype: form 
            ,labelWidth:60
                ,html:desc
            ,frame:true
            ,items:[{
                // textfield
                 fieldLabel:desc
                ,xtype: textfield 
                ,anchor: -18 
                }]
        }]
        });

win.add({
            // form as the only item in window
             xtype: form 
            ,labelWidth:60
                ,html:desc
            ,frame:true
            ,items:[{
                // textfield
                 fieldLabel:desc
                ,xtype: textfield 
                ,anchor: -18 
                }]});

    win.show();


}; 

我的法典有什么错误? 非常感谢。

最佳回答
win;

宣布赢得全球胜利,然后宣布赢得全球胜利

var win = ...

在创造窗户时,将其宣布为地方var。 相反,win 应宣布为非全球性质,但不属于本法典所生活的地方范围(或作为辅助职能予以通过)。 然后删除<代码>win; line and the var keyword,并确保所有代码都提及相同的变量。

而且,如果窗户已经建成,那么你就会在窗户中添加新的成分,你可能不得不打电话<代码>win.doLayout(<>,以便更新窗户布。

问题回答

暂无回答




相关问题
ExtJS load form items/fields from database

I am using ExtJS 3 here. I would like to populate a formpanel from database with fields to be submitted. Basically, I don t know witch fields my form will have and I want to generate all formpanel ...

How to use Ext JS for role based application

I am planning to use Ext JS for a large application. The application s features are role based. When user login, they only see menu and screen features related to them. My server side technology will ...

Dynamically adding a TabPanel to a Panel Region

I have a Panel layout with a TreePanel in one region. A user clicks on an node in the tree and a TabPanel should be displayed in another region with information, editing tools etc. for that tree node....

How to embed Json result within Extjs Panel?

I have some issues with Json result and embed it within the html of the Extjs Panel. Here s that I have managed to get so far. myPanel is embedded within a mainPanel, and I have some shows/hide of ...

Ajax data update. Extjs

I need to keep certain data ( in a grid) up to date and was gonna do a poll to the server every 15 seocnds or so to get the data and refresh the grid, however it feels a bit dirty ( the grid will have ...

Better way to call superclass method in ExtJS

All the ExtJS documentation and examples I have read suggest calling superclass methods like this: MyApp.MyPanel = Ext.extend(Ext.Panel, { initComponent: function() { // do something MyPanel ...

Merged Headers in Ext JS Grid

Is it possible to have two headers in Ext JS grids? I have to show my grid as grouped data.. for example product types and products. In my case I need a grid like this: Field | Product Type A ...

热门标签