
getEl( ) : ExtElement
返回所属的{@link ExtElement}。通常这是一个<
返回所属的ExtElement。通常这是一个<DIV>元素,由onRender方法所创建,但也有可能是autoEl配置项所制定的那个。Returns the ExtElement which encapsulates this Component This will usually be a <DIV> element created by the class's onRender method, but that may be overridden using the autoEl config
该组件若是未完全渲染完毕的话,这个元素是不存在的。The Element will not be available until this Component has been rendered
要登记改组件的DOM事件(相当于组件本身的Observable事件而言),就要这样加入事件侦听器(如render事件): To add listeners for DOM events to this Component (as opposed to listeners for this Component's own Observable events), perform the adding of the listener in a render event listener:
new ExtPanel({
title: 'The Clickable Panel',
listeners: {
render: function(p) {
// Append the Panel to the click handler's argument list
pgetEl()on('click', handlePanelClickcreateDelegate(null, [p], true));
}
}
});
参数项:
返回值:
ExtElement
包含该组件的元素对象。The Element which encapsulates this Component
handler:后面跟的是function, alert()本身就是一个function;
function(){a郸顶策雇匕概察谁畅京lert("")}是function中加了一层function,功能是一样的,只是多穿了层外套。
以下是一个extGrid获取所有选择行ID的函数,返回结果是把所有选择行的ID拼接成用逗号连接的字符串,经测试可用,按你的情况,选择一个就可以达到你的需求了
其中GridPanel1是你的grid,
function getSelectValue() {
var gsm = GridPanel1getSelectionModel(); //获取选择列
var rows = gsmgetSelections(); //根据选择列获取到所有的行
var selectid = ""
for (var i = 0; i < rowslength; i++) {
selectid += rows[i]get('id') + ","; //此处将ID改为您想要取的值
}
return selectidsubstr(0, selectidlength - 1);
}
formpanel配置项中的items是个数组,循环便可以拿到每个formpanel中每一个对象,然后可以就单个对象获得到他的id formpanelitemsitems[1]id
选中某一行,var record = gridgetSelectionModel()getSelection(); 一行的所有数据都在record里面 具体某一列:recordget("列名-dataIndex")
以上就是关于extjs getEl() 什么意思全部的内容,包括:extjs getEl() 什么意思、Ext handler的问题、Ext js 怎样获得 grid 修改后获取当前行 其他列的值(如主键)等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)