Ext js 消息框组件

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/Zhang_h_/article/details/79378858

1.基本弹出框

 Ext.Msg.alert('Title', 'Basic message box in ExtJS');
{
   xtype: 'button',
   text: 'Button',
   listeners: {
      click: function () {
          Ext.Msg.alert('确定', '弹出框显示');
               }
         }
}

2.确认弹出框

 Ext.MessageBox.confirm('Confirm', Msg, optional callbackFunction());
{
   xtype: 'button',
   text: 'confirm',
   listeners: {
       click: function () {
       Ext.MessageBox.confirm('确认么', 'Are you sure you want to do this ?', callbackFunction);
​
       function callbackFunction(btn) {
            if (btn == 'yes') {
                   Ext.Msg.alert('Click', 'You clicked the Yes button');
             } else {
                   Ext.Msg.alert('Click', 'You clicked the No button');
                    }
            };
      }
 }
}

3.提示弹出框

 Ext.Msg.prompt('Name', 'Please enter your name:', function(){});
{
   xtype: 'button',
   text: 'Click Me',
   listeners: {
      click: function () {
      Ext.Msg.prompt('Name', 'Please enter your name:', function (btn, text) {
          if (btn == 'ok') {
              Ext.Msg.alert('Hello', 'Hello ' + text);
            }
      });
    }
  }
}

4.多行用户输入框

Ext.MessageBox.show({
   title: 'Details',
   msg: 'Please enter your details:',
   width:300,
   buttons: Ext.MessageBox.OKCANCEL,
   multiline: true,  // this property is for multiline user input.
   fn: callbackFunction
});
{
    xtype: 'button',
    text: 'Click Me',
    listeners: {
        click: function() {
            Ext.MessageBox.show({
            title: 'Details',
            msg: 'Please enter your details:',
            width:300,
            buttons: Ext.MessageBox.OKCANCEL,
            multiline: true,
            fn: callbackFunction
        });
​
    function callbackFunction (){
        Ext.Msg.alert('status', 'Details entered succesfully');
            }
        }
    }
}

5.是否取消框

Ext.MessageBox.show({
   title: 'Details',
   msg: 'Please enter your details:',
   width:300,
   buttons: Ext.MessageBox.YESNOCANCEL // this button property for all three options YES, NO, Cancel.
});
{
    xtype: 'button',
    text: 'Click Me',
    listeners: {
        click: function() {
            Ext.MessageBox.show({
            title: 'Details',
            msg: 'Please enter your details:',
            width:300,
            buttons: Ext.MessageBox.YESNOCANCEL,
            multiline: true,
            fn: callbackFunction
        });
​
        function callbackFunction (){
            Ext.Msg.alert('status', 'Details entered succesfully');
            }
        }
    }
}
展开阅读全文

js ext

09-02

[code=javascript]rn//此方法在页面加载的时候调用rnfunction submitForm(sortting)rn document.getElementById('ajaxLoading').style.display="block";rn function addFrame()rn var iframe ='';rn if(!document.getElementById('AjaxFrame'))rn tryrn iframe=document.createElement("");rn catch(e)rn iframe=document.createElement("iframe");bu9wi83drn rn iframe.id="AjaxFrame";rn iframe.name="AjaxFrame";rn iframe.setAttribute('style',"display:none;"); rn document.body.appendChild(iframe);rn Ext.get('AjaxFrame').on('load',loadFrameData);rn rn function loadFrameData()rn document.getElementById('ajaxLoading').style.display="none";rn //求大神帮忙重点看一下这句代码,在IE和FF中没有问题,但是Chrome浏览器中取不到值rn var data=Ext.get('AjaxFrame').dom.contentWindow.flightData;rn tryrn if(typeof(data)=='undefined') rn $("#dataCon").empty() ;rn $("#totalRows").html("0") ;rn else rn dataTpl.overwrite('dataCon',data);rn rn if('$tailNumber' != "") rn showInfoDiv(document.getElementsByName('$flightId'),'$tailNumber','$flightId') ;rn rn footerTpl.overwrite('right_footer',data);rn data=null;rn catch(e)rn Ext.removeNode(document.getElementById("AjaxFrame"));rn if(pp&&dataChange(data.data))rn pp.hide();rn rn rn var begindate = $("#s1").val();rn var enddate = $("#s2").val();rn if(enddate!=""&&enddate");rn return;rn rn addFrame();rn jQuery("#flightStatusForm").attr('action','$ctx/flightStatusController/getFilghtStatus.html?pageSize=500&ajax=true&timestamp='+new Date().getTime());rn jQuery("#flightStatusForm").submit();rn rn[/code]rn帮忙看看代码中带注释的一句代码,拜谢 论坛

没有更多推荐了,返回首页