//全局变量 var mynewtable; var selectTypeData; var data = { Columns: [ ["Id", "Id", "", "编号", 1, 1, 1] ] }; //初始化方法 InitEelement(); InitEevent(); for (var i = 0; i < 8; i++) { data.Columns.push([]); } //业务方法 function GetData() { var json = { "ClassName": $("#txtClassName").val(), "TableName": $("#txtTableName").val(), "Description": $("#txtDesc").val(), "ColumnInfoList": [] }; var columns = mynewtable.getData(); if (columns != null) { $.each(columns, function (i, v) { if (v.length >= 7) { var id = v[0]; var propertyName = v[1]; var fieldName = v[2]; var ctype = v[3]; var desc = v[4]; var required = v[5]; var isPk = v[6]; var isIdentity = v[7]; json.ColumnInfoList.push({ ClassProperName: propertyName, DbColumnName: fieldName, Required: required, IsIdentity: isIdentity, IsPrimaryKey: isPk, Description: desc, CodeType: ctype, Id:id }); } }) } return json; } function InitEelement() { mynewtable = $('#examplex').editTable({ field_templates: { 'checkbox': { html: '', getValue: function (input) { return $(input).is(':checked'); }, setValue: function (input, value) { if (value) { return $(input).attr('checked', true); } return $(input).removeAttr('checked'); } }, 'no': { html: '', getValue: function (input) { return $(input).val(); }, setValue: function (input, value) { return $(input).val(value); } }, 'textarea': { html: '