获取所有选中行的索引,存入数组ary中:

var data=$("#dg").datagrid("getSelections");
var ary=[];
for(var i=0;i<data.length;i++){
ary.push($("#dg").datagrid("getRowIndex",data[i]));
}

更新某个列的值为该行其他列运算后得到的值:列money的值为列 amount * unitprice

var data=$("#dg").datagrid("getSelections");
var ary=[];
for(var i=0;i<data.length;i++){
ary.push($("#dg").datagrid("getRowIndex",data[i]));
}
for(var k=0;k<ary.length;k++){
$("#dg").datagrid("updateRow",{
index:ary[k],
row:{
money:data[k].amount*data[k].unitprice
}
});
}

datagrid数据网格获取所有选中行的索引,插入某个列值为其他列的运算值的更多相关文章

  1. EasyUI Datagrid 数据网格 点击选中行 再次单击取消选中行

    适用于jquery-easyui-1.9.15版本: 在项目中全局搜索: opts.singleSelect==true 或者在jquery.easyui.min.js中搜索: opts.single ...

  2. datagrid如何获取选中行的索引

    //datagrid获取选中行 var row =baseSelectgrid.datagrid('getSelected'); // 获取被选中行的索引 index var index=baseSe ...

  3. 数据网格和树-EasyUI Datagrid 数据网格、EasyUI Propertygrid 属性网格、EasyUI Tree 树、EasyUI Treegrid 树形网格

    EasyUI Datagrid 数据网格 扩展自 $.fn.panel.defaults.通过 $.fn.datagrid.defaults 重写默认的 defaults. 数据网格(datagrid ...

  4. 雷林鹏分享:jQuery EasyUI 数据网格 - 添加复选框

    jQuery EasyUI 数据网格 - 添加复选框 本实例演示如何放置一个复选框列到数据网格(DataGrid).通过复选框,用户将可以选择 选中/取消选中 网格行数据. 为了添加一个复选框列,我们 ...

  5. C#-获取datagriview选中行中某一列的值

    获取选中行中某一列的值: int index = dg_Product.CurrentRow.Index; //取得选中行的索引 txt_ProductId.Text = dg_Product.Row ...

  6. c# winform 获取listview 选中行某列的值

    给listview填充数据: for (int i = 0; i < 5; i++) { ListViewItem lvitem = new ListViewItem(); lvitem.Sub ...

  7. jquery Easy UI Datagrid(数据网格)学习心德,附API

    第一步,引入主要的css样式和js文件 <meta http-equiv="Content-Type" content="text/html; charset=ut ...

  8. ElementUI 中 el-table 获取当前选中行的index

    第一种方法:将index放到row数据中 首先,给table加一个属性::row-class-name="tableRowClassName" 然后定义tableRowClassN ...

  9. datagridview 获取选中行的索引

    C# CODE for (int i = 0; i < this.dataGridView1.SelectedRows.Count; i++)//遍历所有选中的行 { this.dataGrid ...

随机推荐

  1. 查看mysql连接情况,以及连接超时时间设置

    查看连接: show processlist;   只展示100个连接 show full processlist;    展示所有连接 查看超时时间: show variables like  '% ...

  2. bzoj 3781 小B的询问——分块

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3781 非常经典的分块套路.于是时间空间比大家的莫队差了好多…… #include<io ...

  3. bzoj 2179 FFT快速傅立叶 —— FFT

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=2179 默写板子,注释的是忘记的地方. 代码如下: #include<iostream& ...

  4. Throwable相关知识1

    Throwable是所有异常Exception和错误Error的祖先 Throwable是java.lang包中一个专门用来处理异常的类.它有两个子类,即Error 和Exception,它们分别用来 ...

  5. php字符编码转换中的iconv与mb_convert_encoding用法

    iconv ( 'UTF-8' , 'GBK' , $str ); //将$str字符串 utf-8 编码转换成 gbk: 另外,5.4.0 这个版本起,字符非法时候会返回 FALSE,除非在输出字符 ...

  6. MFC在对话框中的Picture contrl控件中添加icon图标,并改变icon图标的背景色与对话框背景色一致

    1.在对话框添加Picture Contrl 控件 2.选中控件,修改ID为IDC_STATIC_PICTURE 和 Type属性为icon 其图标改为 3.添加变量m_picture变量名是灰色,说 ...

  7. mysql的权限问题SQLException: access denied for @'localhost' (using password: no)

    遇到了 SQLException: access denied for  @'localhost' (using password: no) 解决办法   grant all privileges o ...

  8. Java 类加载器的作用

    深入探讨 Java 类加载器 成 富, 软件工程师, IBM 中国软件开发中心 成富任职于 IBM 中国软件开发中心,目前在 Lotus 部门从事 IBM Mashup Center 的开发工作.他毕 ...

  9. phpstudy的mysql版本升级至5.7

    phpstudy安装的mysql版本一般都是5.5或5.4的,但是有时候做项目又必须用到mysql5.7版本,所以我们现在来看一下如何在phpstudy的环境下将mysql版本升级至5.7 温馨提醒: ...

  10. 2016四川省赛A,C【写了1w个if的水题】

    A题: #include <iostream> #include <stdio.h> #include <string.h> #include <algori ...