0

有没有其他人遇到过 ext js 复选框未显示的问题?我们已经尝试了一切,甚至下载了架构师软件,但它仍然无法显示......有什么想法吗?

我有一种感觉,它就像我们缺少的一个 css/include 文件,但是我在整个互联网上都查看了,我仍然找不到解决方案。

 {
            xtype: 'checkboxfield',
            anchor: '100%',
            fieldLabel: 'Label2',
            boxLabel: 'Box Label2'
        }

这是面板:

 var manForm = Ext.create('Ext.form.Panel', {
                width: 800,
                style: 'position: relative; left: 20px;',
                renderTo: Ext.getBody(),
                id: 'man_form',
                title: 'Mobile Information',
                waitMsgTarget: true,
                fieldDefaults: {
                    labelAlign: 'right',
                    labelWidth: 85,
                    msgTarget: 'side'
                },
                items: [
                        {                       
                            xtype: 'container',
                           padding: '10px',
                         defaults: { height: 28 },
                            items: [{
                                          xtype: 'hiddenfield',
                                           name: 'id',
                                             id: 'id',
                                    },
                                    {
                                           xtype:'hiddenfield',
                                            name: 'item_id',
                                              id: 'item_id'
                                    },  
                                    {    xtype: 'container', 
                                        layout: 'hbox',  
                                      defaults: { height: 28 },
                                        margin: ' 0 10 0 0',
                                         items: [{
                                                       xtype:'textfield',
                                                  fieldLabel: 'Number',
                                                        name: 'ItemNumber',
                                                          id: 'ItemNumber',
                                                  labelWidth: 45,
                                                       width: 345, 
                                                   },
                                                   {
                                                       xtype:'textfield',
                                                  fieldLabel: 'Name',
                                                        name: 'ItemName',
                                                          id: 'ItemName',
                                                  labelWidth: 70,
                                                       width: 425,                                                  
                                               }] 
                                    },
                                    {
                                           xtype: 'textfield',
                                      fieldLabel: 'Category List',
                                      labelWidth: 140,
                                           width: 700,
                                            name: 'CategoryList',
                                              id: 'CategoryList'
                                    },
                                    {
                                           xtype: 'textfield',
                                      fieldLabel: 'Short Desc For Cat List',
                                            name: 'ShortDescriptionForCategoryList',
                                              id: 'ShortDescriptionForCategoryList',
                                      labelWidth: 140,
                                           width: 600
                                    },
                                    {  xtype: 'container', 
                                      layout: 'hbox',  
                                      margin: ' 0 10 0 0',
                                       items: [{
                                                       xtype: 'textfield',                                        
                                                        name: 'BasePrice',
                                                  fieldLabel: 'Base Price',
                                                          id: 'BasePrice',
                                                  labelWidth: 140,
                                                       width: 270,
                                                       height: 28
                                                },
                                                {
                                                       xtype: 'textfield',                                        
                                                        name: 'RetailPrice',
                                                  fieldLabel: 'Retail Price',
                                                          id: 'RetailPrice',
                                                  labelWidth: 140,
                                                       width: 270,
                                                      height: 28
                                              },{
                xtype: 'checkboxfield',
                anchor: '100%',
                fieldLabel: 'Label2',
                boxLabel: 'Box Label2'
            }


                                              ] 
                                    },
                                    {
                                           xtype: 'textfield',                                        
                                            name: 'ItemImages',
                                      fieldLabel: 'Item Images',
                                              id: 'ItemImages',
                                      labelWidth: 140,
                                           width: 700                                                  
                                    },
                                    {
                                           xtype: 'textfield',                                        
                                            name: 'ItemPrimaryImageUrl',
                                      fieldLabel: 'Primary Image URL',
                                              id: 'ItemPrimaryImageUrl',
                                      labelWidth: 140,
                                           width: 700                                                   
                                    },                                     
                                    {
                                           xtype: 'textfield',                                        
                                            name: 'ItemPrimaryImageAltText',
                                      fieldLabel: 'Primary Image Alt Text',
                                              id: 'ItemPrimaryImageAltText',
                                      labelWidth: 140,
                                           width: 700                                                   
                                    }, 
                                    {
                                           xtype: 'textfield',                                        
                                            name: 'ItemThumbnailUrl',
                                      fieldLabel: 'Thumbnail URL',
                                              id: 'ItemThumbnailUrl',
                                      labelWidth: 140,
                                           width: 700                                                   
                                    }, 
                                    {
                                           xtype: 'textfield',                                        
                                            name: 'ItemThumbnailAltText',
                                      fieldLabel: 'Thumbnail Alt Text',
                                              id: 'ItemThumbnailAltText',
                                      labelWidth: 140,
                                           width: 700                                                   
                                    },                                         
                                    {
                                           xtype: 'button',
                                            text: 'Update',
                                            name: 'new_button',
                                              id: 'new_button',
                                           style: 'margin-left:720px; margin-bottom:5px',
                                         handler: function(event, toolEl, panel){

                                              Ext.Msg.show({
                                                   title:'Update Data',
                                                   msg: 'Are you sure you want to update these settings?',
                                                   buttons: Ext.Msg.YESNO,
                                                   icon: Ext.Msg.QUESTION,
                                                   fn: function(btn){
                                                     if (btn === 'yes'){

                                                       var obj = manForm.getForm().getValues();
                                                       for (var prop in obj) {
                                                         store.getAt(0).set(prop,obj[prop]);                
                                                        //alert(prop + " : " + obj[prop]);
                                                       }

                                                       store.update();
                                                       store.load();
                                                     }
                                                   }
                                              });
                                         }
                                  },
                         ]

                    }],
        });
4

1 回答 1

0

我没有像 kevhender 那样真正测试你的代码。但它适用于他而不是你的事实让我认为你没有 extjs 用于复选框的图像文件。通常它被放置在 images/form/checkbox.gif 中。请检查您的图像文件夹一次。如果是这种情况,开发工具(Firebug 或 chrome 开发工具)控制台也应该抛出一个错误 - 说“在路径 blahblah 找不到文件”或其他东西。

于 2013-07-29T21:09:57.333 回答