Extjs6获取Grid里的数据(数据源)
{
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里的数据(数据源)的更多相关文章
- ExtJs6获取form里的数据
1.PanoramForm.js form的items部分 items: [{ xtype: 'form', id:'customerF', modelValidation: true, defaul ...
- 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的路由方案,与原来的方案在使用上差别不 ...
- APIView里如何获取HTTP里的数据
request.data.get() 获取post方法表单里的数据 request.post.get() 获取post方法表单里的数据 request.GET.get() 获取URL里的数据 r ...
- ligerui_实际项目_003:form中添加数据,表格(grid)里面显示,最后将表格(grid)里的数据提交到servlet
实现效果: "Form"中填写数据,向本页"Grid"中添加数据,转换成Json数据提交,计算总和,Grid文本框可编辑,排序 图片效果: 总结: //disp ...
- .Net NPOI 上传excel文件、提交后台获取excel里的数据
1.导入NPOI.dll 2.添加类NPOIExcel.cs using System; using System.Collections.Generic; using System.Text; us ...
- 关于Android中获取Intent里的数据
Intent获取数据和发送数据的办法: //直接通过Intent发送 intent.putExtra("name","wytings"); //直接通过Inte ...
- extjs6中grid里放置图片
1.加黑体的是实现代码,在view中操作 /** * Created by Wwei on 2017/7/1. */ Ext.define('Admin.view.userpanoram.UserPa ...
- 基于BootStrap的initupload()实现Excel上传和获取excel中的数据
简单说明:后边要做exl解析(还没做呢),所以先有一个excel的的上传以及获取excel中的数据,展示出来. 代码: //html代码 <div class="btn-group&q ...
- angularjs之UI Grid 的刷新 本地数据源及HTTP数据源
关键代码: 如果数据源是本地数据$("#hidJsonData").val("[]"); var myJsonData = []; if ($(&quo ...
随机推荐
- 谈谈final, finally, finalize的区别
final 修饰符(关键字)如果一个类被声明为final,意味着它不能再派生出新的子类,不能作为父类被继承.因此一个类不能既被声明为 abstract的,又被声明为final的.将变量或方法声明为fi ...
- css 子div自适应父div高度
<div class="out"> <div class="a"></div> <div class="b& ...
- SSM整合学习笔记
对学习Spring+Spring MVC+Mybatis过程中出现的问题解决办法汇总 出现的问题 1.pom.xml报错 右键项目->maven->update project 因此每次更 ...
- Docker初步了解
Docker 是什么 https://www.docker.com/ Docker 这个单词英文原意是码头工人,搬运工的意思,这个搬运工搬运的是各种应用的容器. 官方的说法是,Docker 是提供给开 ...
- guava缓存底层实现
摘要 guava的缓存相信很多人都有用到, Cache<String, String> cache = CacheBuilder.newBuilder() .expireAfterWrit ...
- UVA - 1639 -Candy
题目链接:https://vjudge.net/problem/UVA-1639 题目大意: 有两个糖果盒,每个盒子里面有n个糖果,每天随机选一个(概率分别为p,1-p),然后吃一颗糖.直到有一天,打 ...
- 前端javascript中字符串的总结
1.截取方法 截取字符串的abcdefg中的efg. 注意:str.length从1的开始数 var str="abcdefg"; (1).slice() : console.lo ...
- Linux学习笔记--一些错误的记录
运行linux的时候,输入shutdown -r now命令提示:bash:shutdown is not found.出现这个错误是因为这条命令没有加入到系统的配置文件中,运行命令export PA ...
- java服务端和用户端
1.server Logintherad: package com.zdsofe.server; import java.io.InputStream; import java.io.OutputSt ...
- 我的"Hello World!"之旅
不知从何谈起,回想起三年前的自己,那会是高三:同时也是一个让无数骚年悸动的年代,那时候的我也在一个叫做“召唤师峡谷”神奇的地方闯荡了两年.那么,记忆又会回到2012年的元旦,伴随着几个好友,偷偷摸摸地 ...