我正在尝试用图像精灵构建一个加载指示器,我想出了这个功能
function setBgPosition() {
var c = 0;
var numbers = [0, -120, -240, -360, -480, -600, -720];
function run() {
Ext.get('common-spinner').setStyle('background-position', numbers[c++] + 'px 0px');
if (c<numbers.length)
{
setTimeout(run, 200);
}else
{
setBgPosition();
}
}
setTimeout(run, 200);
}
Run Code Online (Sandbox Code Playgroud)
因此输出看起来像这样
我不得不使用setBgPosition(); 在其他内部保持这个循环运行所以现在我的问题是如何我想要[加载完成]后停止此循环?
是否可以从浏览器与桌面应用程序通信?
我想做这样的事,
假设我的Web应用程序中有一个按钮,其中包含指向数据源的URL,当单击按钮时,桌面应用程序将打开并获取该数据源URL并使用桌面应用程序处理数据.
做这样的事情难吗?任何例子?
我有这个布局,一旦我设置一些数据动态布局不调整大小,最终结果是这样的

这是我正在使用的代码
win = Ext.create('widget.window', {
title: 'Layout Window',
closable: true,
closeAction: 'hide',
width: 750,
height: 500,
layout: 'fit',
animCollapse: true,
bodyPadding: 5,
items: [{
xtype: 'container',
layout: 'hbox',
align: 'stretch',
items: [{
xtype: 'fieldset',
flex:1,
title: 'Details',
margins:'0 5 0 0',
layout: 'anchor',
autoHeight: true,
items: [{
xtype: 'displayfield',
fieldLabel: 'Name',
name: 'customer_name',
id: 'customer_name',
width: 300
},{
xtype: 'displayfield',
fieldLabel: 'ID Card',
id: 'customer_id',
name: 'customer_id',
width: 300
},{
xtype: 'displayfield',
fieldLabel: 'Address',
name: 'address',
id: 'address',
width: …Run Code Online (Sandbox Code Playgroud) 如何删除检查所有选项是extjs 4 checkboxmodel?

问候
我试图对所有值进行编码
encodeURIComponent($("#customer_details").serialize());
Run Code Online (Sandbox Code Playgroud)
这不能按预期工作.
有没有办法获取表单上的所有元素并用于encodeURIComponent编码每个值?
如何在Extjs4中将beforerequest和requestcomplete事件添加到特定的ajax请求?
问候
这是我发现的一个精灵

.common-spinner.common-spinner-40x55 {
height: 55px;
width: 40px;
}
.common-spinner {
background: url("images/loading-sprite.png") no-repeat scroll 100% 100% transparent;
}
<div class="loading">
<div class="common-spinner common-spinner-40x55" style="background-position: 0px 0px;"></div>
</div>
Run Code Online (Sandbox Code Playgroud)
任何想法如何从这构建加载动画?我尝试使用for循环来改变位置
for(i=0; i<=720;) {
$('.common-spinner').css('background-position', '-'+i+'px 0px');
i=i+20;
}
Run Code Online (Sandbox Code Playgroud)
但我看不到任何动画可能因为它太快了?
知道如何做到这一点?
问候
我已经使用Erik Hesselink解决方案向jsfiddle添加了代码
我试图用extjs xtemplate循环一个数组并创建一个表
Ext.define('dataview_model', {
extend : 'Ext.data.Model',
fields : [
{name: 'count', type: 'string'},
{name: 'maxcolumns', type: 'string'},
{name: 'maxrows', type: 'string'},
{name: 'numbers', type: 'array'}
]
});
Ext.create('Ext.data.Store', {
storeId : 'viewStore',
model : 'dataview_model',
data : [
{count: '7', maxcolumns: '10', maxrows: '5', numbers: ['100','200','300','400','500','600','700']}
]
});
var tpl = new Ext.XTemplate(
'<tpl for=".">',
'<tpl if="count > 0">',
'<table class="view_table">',
'<tpl for="numbers">',
'<tr>',
'<td>{.}</td>',
'</tr>',
'</tpl>',
'</table>',
'</tpl>',
'</tpl>'
);
Ext.create('Ext.DataView', {
width : 500,
height : 200, …Run Code Online (Sandbox Code Playgroud) 如何在Crystal Report WPF应用程序中获取命令行参数?