码迷,mamicode.com
首页 > Web开发 > 详细

Jquery设置获取list

时间:2017-10-09 19:47:34      阅读:293      评论:0      收藏:0      [点我收藏+]

标签:var   移除   children   obj   lob   val   tab   parent   sub   

            var listItem = "";
            $(‘#AddTable tr‘).each(function () {
                if ($.trim($(this).children("td:eq(0)").text()) == "移除") {
                    var pkid = $.trim($(this).children("td:eq(0)").children("#BusinessCategoryId").val());
                    var EntireCategoryCode = $.trim($(this).children("td:eq(1)").text());
                    var BizCategoryName = $.trim($(this).children("td:eq(2)").text());
                    var RiskLevelId = $.trim($(this).children("td:eq(3)").text());
                    listItem += ‘{"pkid":"‘ + pkid + ‘","Code":"‘ + EntireCategoryCode + ‘","Name":"‘ + BizCategoryName + ‘","RiskLevelId":"‘ + RiskLevelId + ‘",},‘;
                }
            });
            var lists = { "list": "[" + listItem.substring(0, listItem.length - 1) + "]" };

            parent.global = lists

 

          if (global != "") {
                    var dataObj = eval("(" + global.list + ")"); //转换为json对象
                    for (var i = 0; i < dataObj.length; i++) {
                        alert(dataObj[i].pkid);
                    }
                }

Jquery设置获取list

标签:var   移除   children   obj   lob   val   tab   parent   sub   

原文地址:http://www.cnblogs.com/ment/p/7642468.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!