我正在开发一个EXTJS应用程序,我在EXTJS网格中显示数据.
每行都有一个编辑按钮.请检查图像.
我想点击编辑链接,将打开一个弹出窗口,其中包含所有可编辑字段,我可以从那里编辑行.
请帮助我实现这一目标.

这是我的代码.
{
xtype:'actioncolumn',
width:50,
items: [{
icon: 'assets/images/edit.png', // Use a URL in the icon config
tooltip: 'Edit',
handler: function(grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
alert("Edit " + rec.get('ID'));
}
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢
我试图避免在UI下的特定文件夹下重复标题(jcr:title).是否有任何CQ.Ext js get方法来获取文件夹下的所有节点并循环遍历每个节点的jcr:title?
CQ.utils.HTTP.get(parentPath +"/ jcr:content/jcr:title");
这将只获得一个特定节点的标题.
我正在执行一个网页,但在Console上检查时显示以下错误.'未捕获的TypeError:将循环结构转换为JSON'
console.log(JSON.stringify(physicianInfo));
Ext.Ajax.request(
{ async : true,
url : Global.URLPrefix + 'addPhysicianInformation',
method : 'GET',
params : {
physicianInfo : JSON.stringify(physicianInfo), callFrom : 'add' },
success : function (request, resp) {
var physician1 = Ext.decode(request.responseText); console.log(physician1);
Run Code Online (Sandbox Code Playgroud) 我知道网上有很多关于这个问题的答案,但我仍然无法使其发挥作用.
在JSON POST上回调之后,我正在检索一个Object of Array.在浏览器的控制台日志中,数组如下所示:
[Object, Object, Object, Object, Object, Object, Object, Object, Object, Object]
Run Code Online (Sandbox Code Playgroud)
每个对象里面都有这样的东西:
id4blob: "1084"
Run Code Online (Sandbox Code Playgroud)
所以我假设数组可能是这样的(如果我错了,请纠正我):
[{id4blob: "1084"},{id4blob: "2008"}, [...]]
Run Code Online (Sandbox Code Playgroud)
该数组存储在名为stationsParse的变量中
我发现,我想迭代这些值
Ext.iterate
Run Code Online (Sandbox Code Playgroud)
所以我这样做了:
Ext.iterate(stationsParse, function(key, value) {
console.log(key + value);
});
Run Code Online (Sandbox Code Playgroud)
然后尝试了这个(这似乎是相同但在纯JS中)
for (key in stationsParse) {
var value = stationsParse[key];
console.log(key + value);
}
Run Code Online (Sandbox Code Playgroud)
但没有一个工作,我的控制台中没有显示任何内容.尽管如此,该功能已被很好地触发,我可以在Chrome控制台中看到它,但是忽略了for.
我究竟做错了什么 ?这是迭代对象数组的正确方法吗?
我正在进行UI测试ExtJS网络应用程序,我是初学者.我试图使用CasperJS/PhantomJS工具测试ExtJS小部件.此外,我使用Resurrectio生成所需的CasperJs脚本并对其进行必要的更改.
由于ExtJs为其创建的DOM元素动态生成唯一ID,因此我想知道如何在CasperJs脚本中提供这些ID以进行测试.
例如,以下Casper脚本由Resurrectio生成:
casper.waitForSelector("#ext-gen1142 .x-tree-icon.x-tree-icon-parent",
function success() {
test.assertExists("#ext-gen1142 .x-tree-icon.x-tree-icon-parent");
this.click("#ext-gen1142 .x-tree-icon.x-tree-icon-parent");
},
function fail() {
test.assertExists("#ext-gen1142 .x-tree-icon.x-tree-icon-parent");
});
casper.waitForSelector("#gridview-1038",
function success() {
test.assertExists("#gridview-1038");
this.click("#gridview-1038");
},
function fail() {
test.assertExists("#gridview-1038");
});
Run Code Online (Sandbox Code Playgroud)
#ext-gen1142和#gridview-1038是动态创建的ID.如何在测试中提供数据?是否存在任何与代码中的ExtJ一起使用的存根或模拟工具,以便在测试期间在运行时提供这些ID?
我遇到了SinonJS.是否可以使用或者我是否需要使用此答案中提到的CSS或XPath定位器?使用CSS或Xpath定位器的可靠性如何?
提前致谢!
我在一个基于Sencha 2.3.1的项目中工作,但它没有使用ItemID的按钮,但是它正确地使用了ID属性..这是什么错误?
谢谢!!
如何在Extjs中创建水平菜单?
垂直菜单示例:
Ext.onReady(function(){
var menu = Ext.create('Ext.menu.Menu', {
width: 100,
height: 100,
margin: '0 0 10 0',
renderTo: Ext.getBody(),
floating: false,
items: [{
text: 'JavaScript',
},{
text: 'Java'
},{
text: 'C/C++'
}]
});
});
Run Code Online (Sandbox Code Playgroud) 鉴于:
// @private
updateInactiveLabel: function(newInactiveLabel, oldInactiveLabel) {
if (newInactiveLabel != oldInactiveLabel) {
this.getComponent().element.dom.setAttribute('data-inactivelabel', newInactiveLabel);
}
},
Run Code Online (Sandbox Code Playgroud)
以上是Ext.field.Toggle的片段代码
这个方法是否会由扩展Toggle(MyToggle)的用户定义类继承?
我的意思是这// @private是一个防止方法继承的注释?
我刚刚下载了sencha touch 2.4并创建了一个测试Android应用程序.我可以在android 4+上编译和运行应用程序而不会出现问题.但是,当我尝试在Android 2.3上运行它时,应用程序没有通过应用程序加载器指示器并且我记录了该过程没有显示错误.以下是代码:
Ext.application({
name: 'Voice',
requires: [
'Ext.MessageBox'
],
views: [
'Main'
],
icon: {
'57': 'resources/icons/Icon.png',
'72': 'resources/icons/Icon~ipad.png',
'114': 'resources/icons/Icon@2x.png',
'144': 'resources/icons/Icon~ipad@2x.png'
},
isIconPrecomposed: true,
startupImage: {
'320x460': 'resources/startup/320x460.jpg',
'640x920': 'resources/startup/640x920.png',
'768x1004': 'resources/startup/768x1004.png',
'748x1024': 'resources/startup/748x1024.png',
'1536x2008': 'resources/startup/1536x2008.png',
'1496x2048': 'resources/startup/1496x2048.png'
},
launch: function() {
// Destroy the #appLoadingIndicator element
Ext.fly('appLoadingIndicator').destroy();
// Initialize the main view
Ext.Viewport.add(Ext.create('Voice.view.Main'));
},
onUpdated: function() {
Ext.Msg.confirm(
"Application Update",
"This application has just successfully been updated to the latest version. Reload now?",
function(buttonId) …Run Code Online (Sandbox Code Playgroud) 我的问候 !
我试图通过热键专注于第一个pagingtoolbar的按钮.例如,当它将按CTRL + - >组合时,焦点将在pagingtoolbar的第一个启用按钮上.
这时我可以获得fisrt禁用按钮:
Ext.ComponentQuery.query('pagingtoolbar button{isDisabled()}')[0]
Run Code Online (Sandbox Code Playgroud)
但我需要这样的代码:
Ext.ComponentQuery.query('pagingtoolbar button{isEnabled()}')[0]
Run Code Online (Sandbox Code Playgroud)
我以为在Ext.button.Button中有这样的方法,但我找不到它.显然,我可以通过另一种方式解决我的问题,例如,我可以通过以下代码获取分页工具栏中的所有启用按钮:
var buttons = Ext.ComponentQuery.query('pagingtoolbar button');
var en_buttons = [];
for(var i=0;i<buttons.length;i++){
if( !buttons[i].isDisabled() )en_buttons.push(buttons[i]);
}
en_buttons[0].focus(false,100);
Run Code Online (Sandbox Code Playgroud)
但我相信没有必要编写这样的代码,必须通过一行代码来解决.
关于,A
extjs ×10
javascript ×3
aem ×1
android ×1
arrays ×1
casperjs ×1
extjs4 ×1
extjs4.2 ×1
gui-testing ×1
phantomjs ×1
release ×1
sencha-touch ×1
touch ×1