您好,我需要在工具栏中添加一个简单的文本,该文本应该位于工具栏内声明的两个按钮之间,您知道该怎么做吗?请让我知道,谢谢
是否可以在不创建新的自定义主题的情况下更改 Ext JS 中主题的基本代码?
如果有的话,有人可以提供一种方法吗?
谢谢
我在向面板解析数据时面临一个小问题,这是我的代码:
Ext.onReady(function(){
var stockings = [],i=0;
Ext.regModel('Carding', {fields: ['price'] });
var Detailsstore = new Ext.data.Store({
model: 'Carding',
proxy: {
type: 'ajax',
url: 'http://192.168.1.92/testapp/websample%20backup/sample/assets/www/XMLS/xmlformatses.xml',
reader: {
type: 'xml',
record: 'root'
}
},
listeners: {
single: true,
datachanged: function(){
Detailsstore.each(function(r){
stockings[i++]=r.get('price');
});
alert(stockings[3]);//This alert works fine
}
}
});
Detailsstore.read();
alert(stockings[3]);//this alert even being placed after the Detailsstore it shows undefined . . . . .
var showdetails = new Ext.Panel({
scroll :'vertical',
flex:7,
renderTo: 'bubbleCt',
baseCls: 'kiran',
stretchX: true,
html: '<span …Run Code Online (Sandbox Code Playgroud) 我正在做一些简单的JSON解析,它给我一个chrome错误,我在这里缺少什么?
Ext.util.JSON.decode("{info: {synopsis: 'test'}}");
SyntaxError: Unexpected token ILLEGAL
Run Code Online (Sandbox Code Playgroud)
非常感谢
我正在尝试按节目ID过滤我的试镜列表,但是当节目ID为"1"时,所有试镜都会返回"1x"的节目ID.以下是我的代码.
试演模型:
Ext.regModel("Audition", {
fields: [
{name: "id", type: "integer"},
{name: "show_id", type: "integer"},
{name: "date", type: "string"},
{name: "details", type: "string"}
],
belongsTo: 'Show',
proxy: {
type: 'ajax',
url : 'app/data/auditions.json',
reader: {
type: 'json',
root: 'auditions',
id : 'id'
}
},
});
app.stores.auditions = new Ext.data.Store({
autoLoad: true,
model: 'Audition',
sorters: 'id'
});
Run Code Online (Sandbox Code Playgroud)
显示型号:
app.models.Show = Ext.regModel("app.models.Show", {
fields: [
{name: "id", type: "integer"},
{name: "title", type: "string"},
{name: "description", type: "string"},
{name: "opening_night", type: "string"},
{name: "schedule", …Run Code Online (Sandbox Code Playgroud) 我正在开发一个简单的聊天应用程序,我可以在单击REFRESH按钮时查看更新的数据,但是我可以定期从服务器刷新数据(因为我的聊天远程存储在数据库中)
提前致谢.
我正在使用sencha构建移动应用程序.
我创建了一个页面,其中有3-4个日期选择器.我需要以不同的格式显示所有格式,例如dd/MM/yyyy中的一个日期选择器,其他显示MM-yyyy以及另一年只显示MM-yyyy.
请指导我如何做到这一点
我正在使用sencha touch在移动网络应用程序上工作.我使用以下代码创建了一个按钮
{
xtype: 'button',
cls: 'messagesBtn'
}
Run Code Online (Sandbox Code Playgroud)
在App.scss中我添加了以下css,它将此按钮的背景更改为图像
.messagesBtn {
height: 50%;
background: url(../images/home.png) no-repeat;
}
Run Code Online (Sandbox Code Playgroud)
现在这个css工作但是当我按下那个按钮然后它不会删除那些图像并添加另一个我不想要的状态.我想当用户按下此按钮时,应该用当前的图像替换另一个图像.我怎样才能做到这一点?
UPDATE
我更改了代码并添加了pressedCls
{
xtype: 'button',
cls: 'messagesBtn',
pressedCls: 'x-button-pressed'
}
Run Code Online (Sandbox Code Playgroud)
这是css
.messagesBtn {
background: url(../images/home.png) no-repeat;
}
.x-button-pressed {
background: url(../images/appointments.png) no-repeat;
}
Run Code Online (Sandbox Code Playgroud)
以上也不起作用.
使用Sencha Touch(2.2)和Sencha Architect 2
我有一个树形结构,我在其中导航.
节点是元素,元素可以是文件夹或叶子.
要在Ext.dataview.dataview(LIST)上显示元素,我使用商店(storeID:'elementstore')和Ext.dataview.component.Dataitem.
这是我的代码,首先填写LIST,每次我们打开一个文件夹深入树中.
第一次填充商店,禁用事件,因此update()不会被调用两次我将在创建它之后立即切换到此视图.它运作良好,并回馈所需的结果.我在我的列表中显示了第一级文件夹和Leaf.
这是使用onItemTap事件直接在列表中触发的
var EStore = Ext.getStore('elementstore');
EStore.removeAll();
EStore.suspendEvents();
EStore.add(record.get('arrElement'));
EStore.resumeEvents(true);
Run Code Online (Sandbox Code Playgroud)
使用达到的树级别清空和重新填充商店.
这是通过onItemTap事件直接在LIST中触发的
if(record.get('strUIType') === 'folder')
{
INDEX_STACK.push(index);
store = Ext.getStore('elementstore');
store.removeAll();
store.add(record.get('arrElement'));
}
Run Code Online (Sandbox Code Playgroud)
当我试图向后走,在我的树上上升时,出了什么问题.这是位于Sencha控制器中的代码.
它实际上不会回到一个级别,而是返回顶级.ACTIVE_PROJECT是
活动树的索引,它们都位于我的项目存储中.
var popped =INDEX_STACK.pop();
var tab = tabpanel.getParent().getParent().getParent().getComponent('projects_Tab');
if(popped === undefined)
{
tab.setActiveItem(0);
}
else
{
var eStore = Ext.getStore('elementstore');
eStore.removeAll();
//Crashes!
eStore.add(Ext.getStore('projectstore').getAt(ACTIVE_PROJECT).get('arrElement'));
}
Run Code Online (Sandbox Code Playgroud)
你有没有看到eStore.add(....)是崩溃的行,我得到以下错误:
Uncaught TypeError: Cannot call method 'indexOf' of null sencha-touch-all.js:21
Ext.Array.contains.e
Ext.Array.include
Ext.define.join
Ext.define.insert
Ext.define.add
Ext.define.onMain_TabsTap (----Yep this line is my code the …Run Code Online (Sandbox Code Playgroud) 我想在sencha touch中的文本字段中添加一个小图像.例如,用户名文本字段中的小用户图标.
sencha-touch ×10
extjs ×7
javascript ×4
json ×2
datepicker ×1
extjs6 ×1
model ×1
refresh ×1
themes ×1
xml-parsing ×1