extjs 3.4从字段中添加工具提示

时间:2015-04-20 09:35:08

标签: javascript extjs tooltip extjs3

您好我有一些表单字段,我正在尝试添加工具提示。但它没有用。这是我的领域,

var importForm = new Ext.form.FormPanel({
             //html: "<p>Imgae source: <b>img</b> folder in root directory</p>",
            url: '/plugin/ImageImport/admin/import',
            monitorValid: true,
            labelWidth: 175,
            frame: true,
            title: 'Image Import',
            width: 250,
            defaultType: 'textfield',
            defaults: { allowBlank: false },
            items:[
              { fieldLabel: 'Source Folder Path', name: 'imgSourcePath', id:'imgSourcePath' },
              {
                  xtype: 'combo',
                  name: 'folderId',
                  fieldLabel: 'Target Folder',
                  mode: 'local',
                  store: valuesDir,
                  displayField:'key',
                  valueField: 'id',
                  width: 'auto',
                  triggerAction: 'all',
                  emptyText:'Select Folder...',
                  id:'folderId',
                  selectOnFocus:true,
                  allowBlank: false,
                  editable: false,
                },

              {
                  xtype: 'combo',
                  name: 'transformation',
                  fieldLabel: 'Image Transformations',
                  mode: 'local',
                  store: values,
                  displayField:'name',
                  valueField: 'name',
                  width: 'auto',
                  triggerAction: 'all',
                  emptyText:'Select Transformation...',
                  id:'transformation',
                  selectOnFocus:true,
                  allowBlank: false,
                  editable: false,

                },


                   ],

在我的代码结束时,我正在尝试添加工具提示,

Ext.onReady(function(){
    new Ext.ToolTip({
    target: 'imgSourcePath',
    html: 'A very simple tooltip'
        });

 new Ext.ToolTip({
    target: 'folderId',
    html: 'A very simple tooltip'
        });

 new Ext.ToolTip({
    target: 'transformation',
    html: 'A very simple tooltip'
        });

 Ext.QuickTips.init();
});

我也尝试了qtip,但也没有工作。似乎,

 { fieldLabel: 'Source Folder Path', name: 'imgSourcePath', id:'imgSourcePath', qtip: 'This is tool tip' },

请帮帮我...

1 个答案:

答案 0 :(得分:1)

看看这个问题,了解如何将它放在comboBox ExtJs 3.4 : Set tool tip for combo box

希望得到这个帮助。