我正在使用ExtJS Grid,它的速度非常慢,有3000多条记录.排序大约需要4秒钟.
我想也许在我的桌子上使用分页.但是在阅读完文档之后,我仍然不确定分页在extjs中是如何工作的.每次翻页时,这是否都会从服务器中提取数据?我宁愿不是这样的.我希望在浏览器中保存3000条记录,然后渲染的内容只是这些行的一部分.
我也使用Extjs版本4.2.1.如果我升级到版本5.我会获得一些性能改进吗?
我有一个从文件字段扩展的组件,我添加了一个自定义属性'serverPath',我也定义了getter和setter.
代码:
Ext.define('MyApp.ux.Field.File',{
extend:'Ext.form.field.File',
xtype:'myfilefield',
serverPath:'',
getServerPath:function(){
return this.serverPath;
},
setServerPath:function(serverPath){
this.serverPath = serverPath;
}
});
Ext.create('MyApp.ux.Field.File',{
bind:{
serverPath:'{serverPath}'
},
viewModel:{
type:'myViewModel'
}
});
Run Code Online (Sandbox Code Playgroud)
我不会粘贴myViewModel的定义.很简单.
结果证明绑定没有生效.
有人可以帮忙吗?
我试图理解Extjs 5数据模型中的新关联概念.
我有以下型号
// User
Ext.define('App.model.User', {
extend: 'App.model.Base',
fields: [
{name: 'id', type: 'string'},
{name: 'name', type: 'string'},
],
manyToMany: {
Categories: {
type: 'Categories',
role: 'categories',
field: 'categories',
right: true
}
}
});
// Category
Ext.define('App.model.Category', {
extend: 'App.model.Base',
constructor: function () {...},
fields: [
{name: 'id', type: 'string'},
{name: 'categoryName', type: 'string'},
]
});
Run Code Online (Sandbox Code Playgroud)
我为用户提供了以下json:
{ "user": { "id": "1", "name": "Foo", "categories": [1, 2, 3] } }
Run Code Online (Sandbox Code Playgroud)
User加载模型时,它应该使用数据初始化类别存储.
(我的Category模型知道将数字转换为id和categoryName的对象)
出于某种原因,当我尝试获取用户的类别时,商店是空的.
userRecord.categories(); // has …Run Code Online (Sandbox Code Playgroud) 我使用eclipse进行ExtJS开发,我在eclipse中使用ant build,它使用Sencha cmd.我的项目详情是
app.framework.version = 5.1.0.107
app.cmd.version = 5.1.0.26
当我尝试构建项目时,它失败了Yui Parse错误,但我在工作区中找不到任何错误.你能解释堆栈跟踪消息吗?
page:
-before-page:
-init:
-init-compiler:
-copy-app-resources:
[x-compile] Copying page resources to D:\Users\admin\workspaceKepler\Propca\WebContent\build\production\Propca
[x-compile] C2009: YUI Parse Error (missing name after . operator => if (!Propca.view.abstract) Propca.view.abstract = {};) -- unknown-file:143:26
[x-compile] C2009: YUI Parse Error (missing name after . operator => Propca.view.abstract,) -- unknown-file:197633:25
[x-compile] C2009: YUI Parse Error (syntax error => ], 0));) -- unknown-file:197635:1
[x-compile] C2009: YUI Parse Error (missing name after . operator => Propca.view.abstract,) -- unknown-file:197657:25 …Run Code Online (Sandbox Code Playgroud) 我很难理解ExtJS中不同类型的数据绑定,我无法弄清楚这一点:
在两个模型上定义关联时,"hasMany"和"field.reference"之间有什么区别?
我什么时候应该使用"hasMany",什么时候"参考"更好?
例如,如果我想为一个用户定义多个电子邮件地址,那么最佳做法是什么,以便我可以在其他地方使用电子邮件模型?
我知道我有3个问题,但这些问题似乎属于一个问题.
谢谢!
我是ExtJs的新手,想要将使用Sencha CMD创建的ExtJs 5应用程序集成到WebAPI应用程序中!
我进行了BUILD模式的集成,但没有进行开发模式.
关于这篇文章 ,整合步骤如下所示!
步骤1.创建路径:C:\ VCProject\SVCodeCampWeb\WebAPI
步骤2.在步骤1的目录中创建名为"API_NAME"的WebAPI项目.
步骤3.将ExtJS 5框架(ext-5.0.0)移动到步骤1的目录.
步骤4.使用sencha cmd生成extjs应用程序:
C:\VCProject\SVCodeCampWeb\WebAPI\ext-5.0.0>sencha generate app MyApp
C:\VCProject\SVCodeCampWeb\WebAPI\API_NAME\API_NAME\CMDBUG1
步骤5.通过Solution Explorer将ext应用程序包含在Web Api中.
步骤6.使用sencha cmd构建应用程序,如下所示:
C:\Users\albert\Documents\Visual Studio 2013\Projects\BMSIA\BMSIA.Web\BMSJS>sencha app build
作品!!!这些是我在WebAPI for BUILD模式的_Layout.chtml中包含的文件并且有效!
<script src="~/CMDBUG1/build/production/MyApp/app.js"></script>
<link href="~/CMDBUG1/build/production/MyApp/resources/MyApp-all.css" rel="stylesheet" />
Run Code Online (Sandbox Code Playgroud)
错误部分!!!
对于开发模式,我包括以下文件:
< link href="~/CMDBUG1/build/production/MyApp/resources/MyApp-all.css" rel="stylesheet" />
< script src="~/CMDBUG1/ext/ext-all.js"></script>
< script src="~/CMDBUG1/app.js"></script>
Run Code Online (Sandbox Code Playgroud)
但它抛出了这个错误:
TypeError: Ext.application is not a function
Run Code Online (Sandbox Code Playgroud)
如果您需要更多详细信息,请告诉我们!
任何帮助将不胜感激!
我从另一个堆栈溢出帖子(感谢igor)得到了这个很棒的小提琴https://fiddle.sencha.com/#fiddle/h5i.但我有一个问题:如果我选择extjs版本5.1,这是我在我的应用程序中使用的版本,代码不起作用.问题是,当我点击一个月或一年时,日历就会关闭(您可以通过将版本设置为5.1并再次运行小提琴来尝试该行为).我试图自定义部分代码,但没有改变:s.
任何人都有任何想法为什么这不适用于extjs 5.1,或者我怎么能解决这个问题?
提前致谢 :) !
我正在迁移ext js 4 to ext js 5.1.我的extjs 4.2.1中的代码在升级到extjs 5.1之后会出现控制台错误.它在ExtJs 4.2.1中运行良好,不知道它为什么会出错,说
未捕获错误:[Ext.create]无法识别的类名/别名:MyApp.store.LibraryFolderTreeStore
Ext.define('MyApp.view.library.LibraryTreeView', {
extend : 'Ext.tree.Panel',
alias : 'widget.librarytreeview',
requires: [
'MyApp.store.LibraryFolderTreeStore'
],
store : Ext.create("MyApp.store.LibraryFolderTreeStore") // getting error on this line
....
});
Run Code Online (Sandbox Code Playgroud) 在 extjs 应用程序中,我有一个读取 json 文件的树面板,在树面板中我有一个执行操作的复选框,另外我将选中的元素保存在选项卡面板的网格面板中...
\n\n我想删除之前使用复选框的 checkchange 事件保存的商店的任何元素...
\n\n我有这个代码
\n\n风景:
\n\nExt.define(\'app.view.ViewTablaContenido\', {\nextend: \'Ext.window.Window\',\nid: \'viewTablaContenido\',\nshadow: false, \nalias: \'widget.tablaContenido\', \n\ninitComponent: function() {\n .......\n\n var tree = Ext.create(\'Ext.tree.Panel\', {\n title: \'\',\n id: "arbolTabla", \n width: anchoTOC,\n height: altoTOC, \n reserveScrollbar: true,\n loadMask: true,\n useArrows: true,\n rootVisible: false,\n store: \'capa\',\n allowDeselect : true,\n border : true,\n animate: true,\n columns: [{\n xtype: \'treecolumn\',\n text: \'Capa\',\n flex: 5,\n sortable: true,\n dataIndex: \'titulo\'\n },{\n text: \'Metadato\',\n flex: 2,\n dataIndex: \'metadato\',\n renderer: addUrl\n }]\n …Run Code Online (Sandbox Code Playgroud) 我们有一个用 Sencha cmd 5.0.1.231 构建的 ExtJS 5.01 应用程序。
我们面临的问题是浏览器似乎缓存了我们应用程序的旧版本。在为我们的应用程序提供服务时查看 chrome 上的网络流量,我可以看到 app.js、app.css 文件都附加了 ?_dc={timestamp} 。现在,这告诉我每次发布我的应用程序的新版本(更新此时间戳)时,浏览器都应该获得一个新版本。但似乎有时仍然提供旧版本。
还有什么我需要做的胸围缓存吗?
谢谢
extjs5 ×10
extjs ×8
javascript ×4
extjs4 ×2
sencha-cmd5 ×2
associations ×1
binding ×1
caching ×1
difference ×1
field ×1
reference ×1
sencha-cmd ×1
viewmodel ×1