{
xtype: 'grid',
sortableColumns: false,
reference: 'grid',
flex: 1,
store: 'panoram.Panoram',
columns: [{
xtype: 'rownumberer'
},{
text: '主键',
dataIndex: 'id',
name: 'id',
id: 'panoramid',
width: 100
},{
text: 'viewUuid',
dataIndex: 'viewUuid',
width: 100
}, {
text: '缩略图路径',
dataIndex: 'thumbPath',
width: 100,
renderer: function (v) {
return '<image style="width : 185px; height : 70px;" src="'+v+'" />'
}
}, {
text: '名称',
dataIndex: 'name',
width: 100
}, {
text: '风格',
dataIndex: 'style',
width: 100
}, {
text: '户型',
dataIndex: 'houseType',
width: 100
}, {
text: '空间',
dataIndex: 'space',
width: 100
},{
text: '创建时间',
dataIndex: 'createTime',
width:100
},{
text: '操作',
xtype: 'actioncolumn',
width: 100,
items: [{
tooltip: '添加',
icon: 'resources/images/icons/new-icon.png',
handler: 'bringIntoMyStudio'
},{
tooltip: '推荐',
icon: 'resources/images/icons/hot-icon.png',
handler: 'recommendPanoram'
}]
}],
selModel: {
selType: 'checkboxmodel'
},
dockedItems: [{
xtype: 'toolbar',
items: [ '->', {
text: '查询',
iconCls: 'fa fa-search',
reference: 'btn_search',
handler: 'search'
}
, {
text: '清空条件',
iconCls: 'fa fa-search',
listeners: {
click: 'reset'
}
}]
}, {
xtype: 'pagingtoolbar',
store: 'panoram.Panoram',
dock: 'bottom',
displayInfo: true
}],
listeners: {
beforerender: 'gridBeforeRender',
render: 'search'
}
}

这是个items里面的grid,在PanoramController.js里写好方法

var rec = grid.getStore().getAt(rowIndex);//获取当前行的对象
rec.get('id')//get()里面加上dataIndex的值,即可获取该列的值

第一句锁定行,第二句锁定列,获取某一行某一列的数据,也可以用rec把整个grid提交,但是没什么意义
recommendPanoram: function (grid,rowIndex) {
var rec = grid.getStore().getAt(rowIndex);
Common.util.Util.doAjax({
url: Common.Config.requestPath('Panoram', 'recommendPanoram'),
method: 'post',
params: {
id:rec.get('id')
},
callback: function() {
window.store.loadPage(1);
}
}, function () {
Common.util.Util.toast("推荐成功");
});
},

Extjs6获取Grid里的数据(数据源)的更多相关文章

  1. ExtJs6获取form里的数据

    1.PanoramForm.js form的items部分 items: [{ xtype: 'form', id:'customerF', modelValidation: true, defaul ...

  2. ASP.NET Core 2.2 : 十六.扒一扒新的Endpoint路由方案 try.dot.net 的正确使用姿势 .Net NPOI 根据excel模板导出excel、直接生成excel .Net NPOI 上传excel文件、提交后台获取excel里的数据

    ASP.NET Core 2.2 : 十六.扒一扒新的Endpoint路由方案   ASP.NET Core 从2.2版本开始,采用了一个新的名为Endpoint的路由方案,与原来的方案在使用上差别不 ...

  3. APIView里如何获取HTTP里的数据

    request.data.get()  获取post方法表单里的数据 request.post.get()  获取post方法表单里的数据 request.GET.get()  获取URL里的数据 r ...

  4. ligerui_实际项目_003:form中添加数据,表格(grid)里面显示,最后将表格(grid)里的数据提交到servlet

    实现效果: "Form"中填写数据,向本页"Grid"中添加数据,转换成Json数据提交,计算总和,Grid文本框可编辑,排序 图片效果: 总结: //disp ...

  5. .Net NPOI 上传excel文件、提交后台获取excel里的数据

    1.导入NPOI.dll 2.添加类NPOIExcel.cs using System; using System.Collections.Generic; using System.Text; us ...

  6. 关于Android中获取Intent里的数据

    Intent获取数据和发送数据的办法: //直接通过Intent发送 intent.putExtra("name","wytings"); //直接通过Inte ...

  7. extjs6中grid里放置图片

    1.加黑体的是实现代码,在view中操作 /** * Created by Wwei on 2017/7/1. */ Ext.define('Admin.view.userpanoram.UserPa ...

  8. 基于BootStrap的initupload()实现Excel上传和获取excel中的数据

    简单说明:后边要做exl解析(还没做呢),所以先有一个excel的的上传以及获取excel中的数据,展示出来. 代码: //html代码 <div class="btn-group&q ...

  9. angularjs之UI Grid 的刷新 本地数据源及HTTP数据源

    关键代码: 如果数据源是本地数据$("#hidJsonData").val("[]");   var myJsonData = [];   if ($(&quo ...

随机推荐

  1. JDK+Tomcat+Zookeeper+DubboAdmin安装教程

    JDK+Tomcat+Zookeeper+DubboAdmin安装教程 1. 安装内容: JDK 1.8.131 Tomcat 7.0.77 Zookeeper 3.4.9 Dubbo admin 2 ...

  2. VSCode自定义配色方案

    说明 本文更新于2017-07-24,使用VSCode 1.14.1,操作系统为Windows. 配置文件 "文件-首选项-颜色主题"即可显示所有可用的颜色主题,上下选择后Ente ...

  3. VerilogHDL常用的仿真知识

    在描述完电路之后,我们需要进行对代码进行验证,主要是进行功能验证.现在验证大多是基于UVM平台写的systemverilog,然而我并不会sv,不过我会使用verilog进行简单的验证,其实也就是所谓 ...

  4. Eclipse中安装MemoryAnalyzer插件及使用

    Eclipse中安装MemoryAnalyzer插件 一.简介 Eclipse作为JAVA非常好用的一款IDE,其自带的可扩展插件非常有利于JAVA程序员的工作效率提升. MemoryAnalyzer ...

  5. UnityShader之遮挡透明

    好久没写博客了,最近在学shader,不得不说,shader真的非常美妙,我沉迷其中无法自拔= = 之前做过一个遮挡透明的功能,当物体遮挡住主角时,该物体会变成半透明显示出主角.这次同样是遮挡透明的功 ...

  6. 网站相关人员信息记录humans.txt

    前面的话 robots.txt文件告诉搜索引擎哪些页面可以抓取,哪些页面不能抓取.而humans.txt文件则是为人类准备的,包含参加该网页设计和建立的相关人员的信息.本文将详细介绍humans.tx ...

  7. iOS源码博文集锦1

    iOS精选源码 iOS一种弹出视图效果带动画 导航栏显示渐变色,类似qq一样 一分钟找到重力方向 简单高度自定义的日历.可根据项目的需求灵活修改布局 类似于UITableView且极简的图片浏览器 小 ...

  8. Round #427 A. Key races(Div.2)

      time limit per test 1 second memory limit per test 256 megabytes input standard input output stand ...

  9. nodejs-基础

    01-nodejs介绍 1.什么是nodejs 1.(javascript跑在机器端,服务端)Javascript on the machine 2.(跑在谷歌v8引擎上)A runtime for ...

  10. js 重载(overload)

    1.js中不支持重载的语法.(因为js不允许多个同名函数存在) 解决:使用arguments类数组对象接收调用时所有传入的参数值. 2. arguments可以使用length属性,通过下标访问,不能 ...