惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Threatpost
V
Vulnerabilities – Threatpost
TaoSecurity Blog
TaoSecurity Blog
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed
G
GRAHAM CLULEY
S
Securelist
P
Palo Alto Networks Blog
MongoDB | Blog
MongoDB | Blog
A
Arctic Wolf
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
WordPress大学
WordPress大学
Project Zero
Project Zero
T
Threat Research - Cisco Blogs
L
Lohrmann on Cybersecurity
C
Cyber Attacks, Cyber Crime and Cyber Security
F
Fortinet All Blogs
博客园 - 叶小钗
B
Blog RSS Feed
C
Cisco Blogs
Google DeepMind News
Google DeepMind News
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Apple Machine Learning Research
Apple Machine Learning Research
G
Google Developers Blog
K
Kaspersky official blog
D
Docker
Latest news
Latest news
Cisco Talos Blog
Cisco Talos Blog
T
Tor Project blog
Cyberwarzone
Cyberwarzone
Security Latest
Security Latest
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Spread Privacy
Spread Privacy
Microsoft Azure Blog
Microsoft Azure Blog
C
Check Point Blog
J
Java Code Geeks
Simon Willison's Weblog
Simon Willison's Weblog
T
Tenable Blog
Recent Announcements
Recent Announcements
T
Tailwind CSS Blog
H
Help Net Security
L
LINUX DO - 热门话题
T
The Exploit Database - CXSecurity.com
Jina AI
Jina AI
S
SegmentFault 最新的问题
MyScale Blog
MyScale Blog
NISL@THU
NISL@THU
美团技术团队
腾讯CDC

博客园 - Kent

55种网页常用小技巧 - Kent - 博客园 (转文)IP Domain etc. javascript setTimeout 和 setInterval CodeFile、Src、Codebehind三者的差别解释 - Kent - 博客园 Microsoft SQL Server 2005的国际功能(转贴) SQL Server 中易混淆的数据类型 关于 SQL Server 使用 Unicode 数据 Sys.WebForms.PageRequestManagerParserErrorException 错误的解决办法 SQLserver2005中的四个评价函数 常用DOS命令(转贴) 类的一般标准写法 正则表达式(regular expression) C#: 为datatable添加column的方法 C#: 三种符号的区别 C#:List 取代数组的方法 javascript:parseFloat javascript:trim function javascript: split & array Javascript: Replace function.
javascript:eval function
Kent · 2006-09-23 · via 博客园 - Kent

javascript:eval function

 function UltraWebGridText_AfterExitEditModeHandler(gridName, cellId)
    {
      try
      {     
        var grid = igtbl_getGridById(gridName);
        var cell = igtbl_getCellById(cellId);
       
        /// 1.Find the cell of TotalNet(Be filled after calculation)
        var TotalNet_ColumnKey ='';
        for(var i=0;i<grid.Bands[0].Columns.length;i++)
        {
          TotalNet_ColumnKey = grid.Bands[0].Columns[i].Key;
          if(TotalNet_ColumnKey.indexOf('|TotalNet|') > -1)
          {
            break; //Found!
          }
        }
        if(TotalNet_ColumnKey == '') {return;}
        var TotalNet_ColumnKey_Value = TotalNet_ColumnKey.replace(/\L2/g,'L2Value');
        if(TotalNet_ColumnKey_Value == '') {return;}
        var cell_TotalNet = cell.getRow().getCellFromKey(TotalNet_ColumnKey);
        var cell_TotalNet_Value = cell.getRow().getCellFromKey(TotalNet_ColumnKey_Value);
        if(typeof(cell_TotalNet) == 'undefined' || typeof(cell_TotalNet_Value) == 'undefined') { return; }
       
        /// 2.Get the TotalNet's Formula.
        //alert(TotalNet_ColumnKey);
        var Array1 = TotalNet_ColumnKey.split('|'); // L2|143|../popup/abc.aspx|TotalNet|Column1+Column2,Column1$Column2
        var FormulaStr ='';
        if(Array1.length == 5)
        {
            FormulaStr = Array1[4];
        }
        if(FormulaStr == '') {return;}
       
        /// 3.According to the formula,find all the related columns be calculated.(Split)
        var Array2 = FormulaStr.split(','); //Column1+Column2,Column1$Column2
        var Expression =''; //Calcuation real formula: Column1+Column2
        if(Array2.length ==2)
        {
            Expression = Array2[0];
            if(Expression =='') {return;}
            var ColumnsList = '';
            ColumnsList = Array2[1];
            if(ColumnsList =='') {return;}
            var Array3 = ColumnsList.split('$');
            for(var i=0;i< Array3.length;i++)
            {
                var ColumnName = Array3[i];
                ColumnName = trimAll(ColumnName);
                //alert(ColumnName);continue;
                if (ColumnName != '')
                {
                    //Get the ColumnName's Value
                    var ColumnKey ='';
                    for(var j=0;j<grid.Bands[0].Columns.length;j++)
                     {
                        ColumnKey = grid.Bands[0].Columns[j].Key;
                        if(ColumnKey.indexOf('|' + ColumnName + '|') > -1)
                        {
                            break;
                        }
                     }
                    
                    if(ColumnKey ==''){return;} //If anyone Column can't be found,return!
                    var cell_ColumnKey = cell.getRow().getCellFromKey(ColumnKey);
                    if(typeof(cell_ColumnKey) =='undefined') {return;}
                    var value = cell_ColumnKey.getValue();
                    //alert(value);
                    if(value ==null || trimAll(value) == '')
                    {
                        value = '0'; //Note: must be '0' can't be 0!
                    }
                    Expression = replaceSubstring(Expression,ColumnName,value);
                }
            }
            //Calculate by Javascript
            //alert(Expression);
            var Sum = eval(Expression);
            //alert(Sum);
            cell_TotalNet.setValue(Sum);
            cell_TotalNet_Value.setValue(Sum);
         }  
       }
       catch(e)
       {
       }
    }