Bootstrap Table 从新InsertRow 刷新表格 数据的问题处理方案
1、第一步获取数据源
var rows = { //要插入的数据,这里要和table列名一致
SkuCode: data.rows[i].SkuCode,
BarCode: data.rows[i].BarCode,
ProductName: data.rows[i].ProductName,
prospec: data.rows[i].prospec,
ItemName: data.rows[i].ItemName,
ReceiptQuantity: 0,
LnQuantity: data.rows[i].LnQuantity,
NotQuantity: 0,
CostPrice: data.rows[i].CostPrice,
YKPrice: "",
SkuId: data.rows[i].SkuId,
ProId: data.rows[i].ProId
}
$('#gridList').bootstrapTable('insertRow', {
index: 0,
row: rows
});
2、表格改动属性的标签 加入一下两个属性
data-index="' + index + '" onkeyup="GetInputByQuatity(this)"
data-index="' + index + '" onkeyup="GetInputBySumprices(this)"
3、再写入标签两个方法 需要不刷新的字段 保存下来一下两个方法
function GetInputByQuatity(obj)
{
var row = {
pronum: $(obj).val(),
sumprice: 10.0
}
$('#gridList').bootstrapTable('updateRow', { index: $(obj).data('index'), row: row })
}
function GetInputBySumprices(obj) {
var row = {
pronum: 5,
sumprice: $(obj).val()
}
$('#gridList').bootstrapTable('updateRow', { index: $(obj).data('index'), row: row })
}
4、表格刷新
$("#gridList").bootstrapTable('refresh');
Bootstrap Table 从新InsertRow 刷新表格 数据的问题处理方案的更多相关文章
- 关于如何解决bootstrap table 列 切换 刷新 高度不一样
在使用bootstrap table时候,碰到bootstrap table 列 切换 刷新 高度不一样的问题,如图所示: 解决这个问题很简单,在你的页头加一句<!DOCTYPE html> ...
- BootStrap table动态增删改表格内数据
1:添加一个[操作]列 { title: "操作", align: 'center', valign: 'middle', width: 160, // 定义列的宽度,单位为像 ...
- bootstrap table简洁扁平的表格
使用方法 1.在html页面的head标签中引入Bootstrap库(假如你的项目还没使用)和bootstrap-table.css. <link rel="stylesheet&qu ...
- bootstrap table通过ajax获取后台数据展示在table
1. 背景 bootstrap table 默认向后台发送语法的dataType为 json,但是为了解决跨域问题我们需要将dataType改为jsonp,这时就需要修改bootstrap table ...
- bootstrap table 保留翻页选中数据
$(function () { $('#exampleTable').on('uncheck.bs.table check.bs.table check-all.bs.table uncheck-al ...
- tp3.2和Bootstrap模态框导入excel表格数据
导入按钮 <button class="btn btn-info" type="button" id="import" data-to ...
- bootstrap table分页后刷新跳到第一页
之前这样写是不行的,这时候页数还是原来的页数 $('#tb_departments').bootstrapTable(('refresh')); 需要改成: $("#tb_departmen ...
- bootstrap table使用colResizable后表格不能自适应
窗口缩小放大后,b表格不能自适应,table加了宽度没效果,求教
- bootstrap table checkbox获得选中得数据
var idlist = $('#table').bootstrapTable('getAllSelections'); for (var i = 0; i < idlist.lengt ...
随机推荐
- Linux环境下安装MySQL(解压方式)
1.将安装包放在服务器上:mysql-5.6.37-linux-glibc2.12-x86_64.tar.gz 2.将安装包解压:tar -zxvf mysql-5.6.37-linux-glibc2 ...
- Redis学习笔记(1):Redis的说明与安装
Redis学习笔记(1):Redis说明的安装 说明 什么是Redis REmote DIctionary Server(Redis) 是一个由Salvatore Sanfilippo写的key-va ...
- for(String s:list)的运行
源码 List<String> list = new ArrayList<>(); for (String s:list){ } class文件 List<String& ...
- 关于node.js的安装与删除
安装node.js 先切换到root用户安装 openssl-devel su - yum install openssl-devel 下载源代码自己编译以下代码中的tar.gz包根据node.js官 ...
- Gym - 100676F Palindrome —— 并查集
题目链接:https://vjudge.net/contest/155789#problem/E 题解: 由于是回文串,所以可以先将在对称位置的字符放在同一个集合(如果期间有两个非‘?’,且不相等,则 ...
- hadoop,帮我解了部分惑的文章
http://blog.csdn.net/qianshangding0708/article/details/47423613
- html5--5-12 渐变色
html5--5-12 渐变色 学习要点 掌握渐变色的绘制方法 渐变色绘制方法 createLinearGradient() 创建线性渐变 createLinearGradient(x1,y1,x2, ...
- C#中XML解析的增加修改和删除
01添加xml节点 private void AddXml(string image, string title) { XmlDocument xmlDoc = n ...
- codeforces 669B B. Little Artem and Grasshopper(水题)
题目链接: B. Little Artem and Grasshopper time limit per test 2 seconds memory limit per test 256 megaby ...
- 日志的打印 —— Java 支持
1. java.util.logging.Logger 日志级别(logLevel) OFF,Integer.MAX_VALUE SEVERE,1000 WARNING,900 INFO,800 CO ...