<table class = "table jtable table-bordered table-striped hide" id = "table_1" >
<thead>
<tr>
<th style = "width: 50px;" >序号</th>
<th style = "width: 150px;" >预算编号</th>
<th style = "width: 100px;" >参考编号</th>
<th style = "width: 220px;" >预算名称</th>
<th style = "width: 100px;" class='teaDept' >部门</th>
<th style = "width: 100px;" class='teaBrand'>品牌</th>
<th style = "width: 100px;" class='teaBudItem'>预算科目</th>
<th style = "width: 50px;" class='teaCompany'>公司</th>
<th style = "width: 100px;" >预算币种</th>
<th style="width: 50px;">操作</th>
</tr>
</thead>
<tbody>
<tr class = "tr_row" >
<td>
<span class="label label-sm label-success label-mini"> 1 </span>
</td>
<td>
<input class = "form-control input-sm txt-required valid eaBudcode" id = "BudgetCode" name = "BudgetCode" type = "text" value = "" placeholder = "支持系统生成/用户输入,系统内唯一即可" data-bind="value:BudgetCode"/>
</td>
<td>
<input class = "form-control input-sm eaClientCode" id = "tbClientCode" name = "tbClientCode" type = "text" value = ""/>
</td>
<td>
<textarea rows = "2" class = "form-control input-sm txt-required valid eaBudName" id = "tbBudName" name = "tbBudName" ></textarea>
</td>
<td class='teaDept'>
<select class = "fk-select form-control eaDept" id = "ddlDept" name="ddlDept" ></select>
</td>
<td class='teaBrand'>
<select class = "fk-select form-control eaBrand" id = "ddlBrand" name="ddlBrand" >
</select>
</td>
<td class='teaBudItem'>
<select class = "fk-select form-control eaBudItem" id = "ddlBudItem" name="ddlBudItem">
</select>
</td>
<td class='teaCompany'>
<select class = "fk-select form-control eaCompany" id = "ddlCompany" name="ddlCompany">
</select>
</td>
<td>
<select class = "fk-select form-control eaCurrency" id = "ddlCurrency" name="ddlCurrency" >
</select>
</td>
<td>
<div class="input-group btn-group-xs margin-bottom-5">
<span class="input-group-btn margin-top-5" data-title="faplus">
<a href="javascript:void(0);" class="btn default btn-xs" name="CopyTr" title="复制"><i class="fa fa-plus"></i></a>
</span>
<span class="input-group-btn " data-title="faplus">
<a href="javascript:void(0);" class="btn default btn-xs" name="DelTr" title="删除"><i class="fa fa-minus"></i></a>
</span>
</div>
</td>
</tr>
</table>

以下是table的js

 /* 获取table表格的数据项.*/
function getTableData() {
var data = [];
$("#table_1 tbody tr").each(function(i, item) {
data.push({
"BudgetCode" : $("input[name='BudgetCode']", item).val(),
"ClientCode" : $("input[name='tbClientCode']", item).val(),
"BudgetName" : $("textarea[name='tbBudName']", item).val(),
"DeptID" : $("select[name='ddlDept']", item).val(),
"BrandID" : $("select[name='ddlBrand']", item).val(),
"BudgetItemID" : $("select[name='ddlBudItem']", item).val(),
"CompanyID" : $("select[name='ddlCompany']", item).val(),
"CurrencyID" : $("select[name='ddlCurrency']", item).val(),
"BudCategoryID": $("#ddlBudCategory").val(), //预算类别id
"ParentID": $("#tbParBudCode").val() //上级编号
});
});
//console.log("data1:" + data);
return data; //返回数据
}

table中填写数据并批量增加的更多相关文章

  1. js穿梭框;将两个table中的数据选中移动

    将table中选中的数据移动到右边: 点击一行中的任意一个位置,使其选中: 注:attr()和prop()都是jquery的方法: .attr() : 获取匹配的元素集合中的第一个元素的属性的值 或 ...

  2. 向已有的table中插入数据

    table: <table id="seleted-table" class="table table-bordered table-hover" sty ...

  3. 从Excel中读取数据并批量写入MySQL数据库(基于MySQLdb)

    一.Excel内容如下,现在需要将Excel中的数据全部写入的MySQL数据库中: 二.连接MySQL的第三方库使用的是“MySQLdb”,代码如下: # -*- coding:utf-8 -*-im ...

  4. table中实现数据上移下移效果

    html 由于vue+Element项目中的table,没有开放的上移下移的api,但是能对数据操作,故思路为数组中的一条数据,再重新添加一条数据,办法有点笨,但是好歹也是实现了,望有好的办法的,请留 ...

  5. ado.net中,数据的批量处理

    //btBigImport按钮点击事件 private void btBigImport_Click(object sender, RoutedEventArgs e)        { //连接字符 ...

  6. Jquyer table 中的数据分页

    直接上代码,复制出来就可以使用 <!DOCTYPE html> <html> <head lang="en"> <meta charset ...

  7. 向多页TABLE中插入数据时,新增行总是在当前页的最后一行

    CODE IN CO OATableBean table = (OATableBean)webBean.findChildRecursive("LineTable"); int n ...

  8. 从Excel中读取数据并批量写入MySQL数据库(基于pymysql)

    一.Excel内容时这样的: 二.最初的代码是这样的: # -*- coding:utf-8 -*-import pymysqlfrom xlrd import open_workbook class ...

  9. 执行相应操作后,将表单及table中数据清空

    使用 ccms.util.clearForm('要清空的表单的id'); $("#table中显示数据部分的id").empty();

随机推荐

  1. ZooKeeper保证之单一视图(Single System Image)

    由于ZooKeeper的数据模型简单且全部在内存中,ZooKeeper的速度非常快.它提供了一系列保证(Guarantees): • 顺序一致性(Sequential Consistency) • 原 ...

  2. <已解决>使用selector设置Button按下松开的样式以及 <item> tag requires a 'drawable' attribute or child tag defining a drawable 报错

    <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="ht ...

  3. Spring,FetchType.LAZY和FetchType.EAGER什么区别?

    1.FetchType.LAZY:懒加载,加载一个实体时,定义懒加载的属性不会马上从数据库中加载. 2.FetchType.EAGER:急加载,加载一个实体时,定义急加载的属性会立即从数据库中加载. ...

  4. IOS 拖拽事件(手势识别)

    @interface NJViewController () @property (weak, nonatomic) IBOutlet UIView *customView; @end @implem ...

  5. 使用 Repeater方式和完全静态页面使用AJAX读取和提交数据

    1.使用Repeater方式: Comments.aspx <html xmlns="http://www.w3.org/1999/xhtml"> <head r ...

  6. cocoapods 类库管理利器

    作为iOS开发者,第三方类库的使用是最经常的,但鉴于第三方类库的不断更新以及其可能需要依存其他类,如果要使用最新版那么我们需要重新下载再添加到项目中,无疑带来一些繁琐的麻烦,那么现在这里就有一款能解决 ...

  7. css中让元素隐藏的多种方法

    { display: none; /* 不占据空间,无法点击 / } { visibility: hidden; / 占据空间,无法点击 / } { position: absolute; top: ...

  8. SVG path

    在网页上画一图形,比如星星或波浪线,开始是想着图形软件画一个的,后来发现SVG这绘图程序的语言,感觉甚是可以,就发了些时间学了一下,在此做一简单分享和记录. 菜鸟上是这么介绍的(SVG 是使用 XML ...

  9. jenkins重置build序号

    来源:https://www.jianshu.com/p/e342b52d45e1 执行命令:item = Jenkins.instance.getItemByFullName("your- ...

  10. SpringBoot显式事务

    参考:https://www.jianshu.com/p/f5fc14bde8a0 后续测试代码的完整项目:https://files.cnblogs.com/files/hellohello/dem ...