ComponentArt:Grid args.get_item().getMember("CURRENCY").get_value()

ComponentArt:Grid中的当前行
None.gif var  varNumber = 0 ; // 记录用户把所有已选择的CheckBox取消了选择
None.gif
    
None.gif         
function  Select(sender,args)  // args本身带了具体的行包括行id
ExpandedBlockStart.gifContractedBlock.gif
          dot.gif {       
InBlock.gif                
var varCurrency="";   
InBlock.gif                
var varSZDW;    //涉帐单位
InBlock.gif
                if(!args.get_item().getMember("choice").get_value())//为真时,表示当前没有被选中的行
ExpandedSubBlockStart.gifContractedSubBlock.gif
                dot.gif{
InBlock.gif                    varCurrency  
=  args.get_item().getMember("CURRENCY").get_value();
InBlock.gif                    varSZDW 
= args.get_item().getMember("COMP_C_CNAME").get_value();
InBlock.gif                    
if(varNumber==0)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        document.getElementById(
"txtCurrency").value=varCurrency;                       
InBlock.gif                        document.getElementById(
"hid1").value=varSZDW;
InBlock.gif                        varNumber
++;//第一次有行被选中,记录所选行总数的变量加一
ExpandedSubBlockEnd.gif
                    }

InBlock.gif                    
else//已经有行被选
ExpandedSubBlockStart.gifContractedSubBlock.gif
                    dot.gif{
InBlock.gif                        
//再次选中的行的CURRENCY列与前面已选保存在txtCurrency中的货币种类不同,否定当前行,不需要判断涉账单位是否相同
InBlock.gif
                        if(args.get_item().getMember("CURRENCY").get_value()!=document.getElementById("txtCurrency").value)
ExpandedSubBlockStart.gifContractedSubBlock.gif                         
dot.gif{
InBlock.gif                            args.get_item().setValue(
1false);
InBlock.gif                              alert(
"币种不同");
ExpandedSubBlockEnd.gif                          }

InBlock.gif                          
else//货币种类相同,只需记载varNubmer++;
ExpandedSubBlockStart.gifContractedSubBlock.gif
                          dot.gif{
InBlock.gif                              
if(args.get_item().getMember("COMP_C_CNAME").get_value()!=document.getElementById("hid1").value)//涉账单位不同
ExpandedSubBlockStart.gifContractedSubBlock.gif
                              dot.gif{
InBlock.gif                                   args.get_item().setValue(
1,false);
InBlock.gif                                   alert(
"涉账单位不同");                                  
ExpandedSubBlockEnd.gif                              }

InBlock.gif                              
else//涉账单位也相同,才需记载varNubmer++;
ExpandedSubBlockStart.gifContractedSubBlock.gif
                              dot.gif{   
InBlock.gif                                  varNumber
++
ExpandedSubBlockEnd.gif                              }

ExpandedSubBlockEnd.gif                          }

InBlock.gif                         
ExpandedSubBlockEnd.gif                    }

InBlock.gif                    
ExpandedSubBlockEnd.gif                }

InBlock.gif                
else//为真时,表示当前有选中行,需要取消某些行
ExpandedSubBlockStart.gifContractedSubBlock.gif
                dot.gif{
InBlock.gif                    
InBlock.gif                    varNumber
--;//每取消一个,只需把记录所选行总数减一
InBlock.gif
                    if(varNumber==0)//所有行都被取消了
ExpandedSubBlockStart.gifContractedSubBlock.gif
                    dot.gif{
InBlock.gif                        document.getElementById(
"txtCurrency").value="";//最后置空该TextBox
ExpandedSubBlockEnd.gif
                    }

ExpandedSubBlockEnd.gif                }
                
InBlock.gif              
InBlock.gif           
InBlock.gif            
InBlock.gif               
InBlock.gif
InBlock.gif            
var ss;
InBlock.gif            ss
=GetCheckedItems(Grid1,1);            
InBlock.gif            
var arrTmp = ss.split(",");
InBlock.gif            
var varTemp=0;
InBlock.gif            
for(var i = 0; i < arrTmp.length-1; i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                varTemp
+=parseFloat(arrTmp[i]);
ExpandedSubBlockEnd.gif            }
           
InBlock.gif            document.form1.txtAmount.value
=varTemp;//赋值给总金额TextBox
InBlock.gif
           
InBlock.gif       
InBlock.gif           
ExpandedBlockEnd.gif         }
 
客户端事件注册:
None.gif   </ Levels >
None.gif                
< ClientEvents >
None.gif                    
< ItemCheckChange  EventHandler ="Select"   />
None.gif                
</ ClientEvents >
None.gif   
</ ComponentArt:Grid >

转载于:https://www.cnblogs.com/simhare/archive/2007/07/31/838038.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值