Coolite Toolkit 学习一

 
获得一个对象
格式:#{控件的Id},
客户端使用: <ext:Button ID="Button6" runat="server" Text="获得控件对象" OnClientClick="alert( #{Button6})" >
</ext:Button> //返回一个 [object,Object]对象组
修改: alert(#{Button6}.id) 返回 Button6 修改: alert(#{Button6}.text) 返回 获得控件对象
服务端使用: 必须是 拼装在String里面的!
控件取值、赋值的方式:
根据控件属性:
可使用 #{控件的Id}. getText() 或 #{控件的Id}. getValue() 获得控件属性值;
反之使用 #{控件的Id}. setText('内容') 或 #{控件的Id}.setText('内容') 设置控件属性值;
-----------------------------------------------------------------------------------------------------
<ext:Button>控件:
<ext:Button ID="Button1" runat="server" Text="获得控件对象" OnClientClick="alert(#{Button1}.getText())" >//返回 获得控件对象
        </ext:Button>
<ext:Button ID="Button1" runat="server" Text="获得控件对象" OnClientClick="#{Button1}.setText('设置控件对象内容')" >
</ext:Button> //Text="设置控件控件对象内容"
<ext:Label 控件:   #{控件的Id}. getText();             反之设置: setText('内容')
<ext:TextField 控件:   #{控件的Id}. getValue();             反之设置: setValue('内容')
客户端对话框
操作与ext 3.0相同,
alert使用:
格式:Ext.Msg.alert('标题',‘内容’,'回调函数');
confirm使用:
   格式: Ext.Msg.confirm('标题', '你想删除','回调函数');
prompt使用:
格式: Ext.Msg.prompt('title','message',callback);
-------------------------------------------------------------------------------------------------------------------------
<script type="text/javascript">
var showResultText = function(btn, text) {
Ext.Msg.alert('Button Click', 'You clicked the ' + btn + ' button and entered the text "' + text + '".');
};

</script>

<ext:Button ID="Button3" runat="server" Text="获得控件对象" OnClientClick=" Ext.Msg.prompt('Title', 'Please enter your name:',showResultText)">
</ext:Button>
---------------------------------------------------------------------------------------------------------------------------
show使用:
<ext:Button ID="Button2" runat="server" Text="获得控件对象" OnClientClick="Ext.Msg.show({title:'Save Changes?',msg: 'Would you like to save your changes?',buttons: Ext.MessageBox.YESNOCANCEL,icon: Ext.Msg.QUESTION});">
</ext:Button>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值