EXT gridpanel中实现下拉框
程序员文章站
2022-03-26 23:02:28
...
afterrender:function(){ var hostId = Ext.getCmp("vCpu_numa_host_id").getValue(); var nodeName = Ext.getCmp("vCpu_numa_node_id").getValue(); ajaxRequest({ url: getContextPath() + '/load.action', params : {'id': hostId, 'nodeName': nodeName}, async: '1', loadMastTarget: Ext.getBody(), complete : function(hCpuList) { if (hCpuList) { Ext.getCmp('vCpu_numa_bind_id').getColumnModel().setRenderer(1,function(value, cellmeta, record) { if (hCpuList == undefined || hCpuList == '') { return "<select id='numaCore_"+record.get("vmCPU") + "' disabled='disabled' >" +"<option value='-1' selected = 'selected'>" + platform_common_select + "</option></select>" } else { var temp = ''; for (var i = 0; i < hCpuList.length; i++) { var pt = hCpuList[i].id; var ptname = hCpuList[i].value; temp = temp + '<option value=\'' + pt + '\'>' + ptname + '</option>'; } return "<select id='numaCore_"+record.get("vmCPU") + "' >" + "<option value='-1' selected = 'selected'>" + platform_common_select + "</option>" + temp + "</select>" } }); } } }); }
select: function(group, value) { var hostId = Ext.getCmp("vCpu_numa_host_id").getValue(); var nodeName = Ext.getCmp("vCpu_numa_node_id").getValue(); ajaxRequest({ url: getContextPath() + '/load.action', params : {'id': hostId, 'nodeName': nodeName}, async: '1', loadMastTarget: Ext.getBody(), complete : function(hCpuList) { if (hCpuList) { for(var i = 0; i < cpuNum; i++) { var str = ''; if (hCpuList == undefined || hCpuList == '') { str = "<select id='numaCore_"+i + "' disabled='disabled' >" +"<option value='-1' selected = 'selected'>" + platform_common_select + "</option></select>" } else { var temp = ''; for (var j = 0; j < hCpuList.length; j++) { var pt = hCpuList[j].id; var ptname = hCpuList[j].value; temp = temp + '<option value=\'' + pt + '\'>' + ptname + '</option>'; } str = "<select id='numaCore_"+i + "' >" + "<option value='-1' selected = 'selected'>" + platform_common_select + "</option>" + temp + "</select>" } var dom = document.getElementById("numaCore_" + i); dom.innerHTML = str; } } } }); }
https://www.cnblogs.com/xdp-gacl/p/3938361.html
https://my.oschina.net/vernon/blog/363693
上一篇: MySQL的SSL加密连接与性能开销
下一篇: ExtJS框架学习笔记
推荐阅读
-
ext.net2.0 GridPanel 实现自动换行
-
Jquery编程开发中可多选的下拉框如何实现?
-
JavaScript实现获取select下拉框中第一个值的方法
-
jQuery实现点击下拉框中的值累加到文本框中的方法示例
-
thinkphp中在编辑一条数据时不用JS实现自动选中下拉框
-
tapestry 4.02中封装ext的GridPanel组件
-
JavaScript 编程开发中基于jQuery下拉框实现方法
-
JavaScript实现向select下拉框中添加和删除元素的方法
-
vue+Element中table表格实现可编辑(select下拉框)
-
Extjs中ComboBoxTree实现的下拉框树效果(自写)