我的问题是除了totalRecords之外如何获取元数据,在我的例子中它是版本,代码,searchquery(请查看json).
{
"result": {
"version":"1",
"code":"200",
"searchquery": "false",
"totalRecords": "2",
"account":[
{
"lastname": "Ivanoff",
"firstname": "Ivan",
"accountId":"1"
},
{
"lastname": "Smirnoff",
"firstname": "Ivan",
"accountId":"2"
}
]
}
Run Code Online (Sandbox Code Playgroud)
}
这是我的模型:
Ext.define("test.Account", {
extend: "Ext.data.Model",
fields: [
{name: 'accountId', type: 'string'},
{name: 'lastname', type: 'string'},
{name: 'firstname', type: 'string'}
]
});
Run Code Online (Sandbox Code Playgroud)
并存储:
Ext.define("test.TestStore", {
extend: "Ext.data.Store",
model: "test.Account",
proxy: {
type: "ajax",
url: "users.json",
reader: {
type : 'json',
root : 'result.account',
totalProperty: "result.totalRecords"
}
},
listeners: {
load: function(store, records, success) …Run Code Online (Sandbox Code Playgroud) 我使用PHP5开发了一个网站.现在,我想在跨平台移动应用程序中总结我的网站的主要功能.
我做了一些关于可以做到这一点的框架的研究.我发现'jQuery Mobile','SenchaTouch'和'Cordova'是最受欢迎的.但我想开发一个应用程序,它需要连接到数据库,并且可以在iOS和Android上移植(至少).
我尝试了'jQuery Mobile'但是应用程序需要在Web浏览器中打开才能显示应用程序(就像一个简单的网站).例如,我想打开我的应用程序,就像当前的手机应用程序,而不通过使用数据库连接的Web浏览器(具有与当前网站相同的行为,并显示MySQL请求的内容,但没有Web浏览器).
是否可以使用jQuery Mobile或其他?或者我必须通过网络浏览器?有人可以帮帮我吗?
mobile mobile-application sencha-touch jquery-mobile cordova
可以使用joinWithSeparator方法使用特定分隔符将字符串数组连接在一起.
let st = [ "apple", "pie", "potato" ]
st.joinWithSeparator(", ")
Run Code Online (Sandbox Code Playgroud)
结果我们将有"苹果,馅饼,土豆".
如果我在数组中归因于字符串怎么办?有没有简单的方法将它们组合成一个大的属性字符串?
在java和C++中,我们可以全局存储一个变量,并从项目的任何位置访问它的值.说,我一个叫做类中Residence,我保存residenceNumber它是INT一个叫做全局变量houseNumberGlobalVariable.
现在,我可以houseNumberGlobalVariable从项目中的任何类访问 .以类似的方式,EXTJS我可以使用全局变量.
我需要从一个类中设置一个值,然后从另一个类中访问它.EXT JS中的等价物是什么.我不认为EXTJS中有一个全局变量概念,但它的等价物是什么?
我会通过Apple JS在网络上使用“使用Apple登录”。可以在以下位置找到代码示例:https : //developer.apple.com/documentation/signinwithapplejs/configuring_your_webpage_for_sign_in_with_apple
现在的问题是:什么是客户ID,在哪里可以找到它。我在https://developer.apple.com/account/resources/identifiers/list上测试了应用程序ID的标识符,并测试了服务ID的标识符。如果我单击按钮并在Mac上使用Touch ID进行验证,则会收到错误“ AUTH_ALERT_SIGN_UP_NOT_COMPLETED”:
这是使用的代码:
<html>
<head>
</head>
<body>
<button id="sign-in-with-apple-button"> Sign In with Apple </button>
<script type="text/javascript" src="https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js"></script>
<script type="text/javascript">
AppleID.auth.init({
clientId : 'unknown',
scope : 'email',
redirectURI: 'https://mytld/test.php',
state : 'DE'
});
const buttonElement = document.getElementById('sign-in-with-apple-button');
buttonElement.addEventListener('click', () => {
AppleID.auth.signIn();
});
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我没有对test.php的请求。
执行此行时,我在iOS中频繁出现EXC_BAD_ACCESS崩溃:
while (sqlite3_step(statement) == SQLITE_ROW) {
}
Run Code Online (Sandbox Code Playgroud)
它用于在我的(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 功能中提供结果.
有任何想法吗?SQL等看起来很好,数据库正在后台线程中更新,之后我调用前台线程来更新UI.
我正在使用Sencha Architect 2.我正在尝试使用文本搜索和显示结果的表格生成通用UI元素.通用意味着我想将它用于几种不同类型的搜索,例如用户,角色或其他类型的搜索.
所以我在这个关于Sencha Architect 2的上下文中肯定喜欢它总是生成类.这是我生成的类:
Ext.define('ktecapp.view.ObjSearchPanel', {
extend: 'Ext.container.Container',
alias: 'widget.objsearchpanel',
height: 250,
id: 'UserSearchPanel',
itemId: 'UserSearchPanel',
width: 438,
layout: {
columns: 3,
type: 'table'
},
initComponent: function() {
var me = this;
Ext.applyIf(me, {
items: [
{
xtype: 'textfield',
itemId: 'txtSearchText',
fieldLabel: 'Search Text',
colspan: 2
},
{
xtype: 'button',
id: 'searchObj',
itemId: 'searchObj',
text: 'Search',
colspan: 1
},
{
xtype: 'gridpanel',
height: 209,
itemId: 'resultGrid',
width: 430,
store: 'UserDisplayStore',
colspan: 3,
columns: [
{
xtype: 'gridcolumn',
width: …Run Code Online (Sandbox Code Playgroud) 任何人都知道如何为ExtJS中的任何字段的子字段建模?例如
Ext.data.Model:
fields:[
{name: 'id', type: 'int'},
{name: 'title', type: 'string'},
{name: 'description', type: 'string'},
{name: 'priority', type: 'auto', fields:[
{name: 'code', type: 'string'}
]},
{name: 'createdBy', type: 'auto'},
]
Run Code Online (Sandbox Code Playgroud)
然后在我的网格面板中
Ext.grid.Panel
columns:[
{header:'Title', dataIndex:'title', flex:1},
{header:'Priority', dataIndex:'code'}
],
Run Code Online (Sandbox Code Playgroud)
知道如何在'优先级'下访问dataIndex'代码'吗?提前致谢!
基于Sencha的MVC应用程序架构指南中的文件结构部分创建一个新的Ext JS 4.1.1应用程序我最终得到了这个结构:
/wwwroot
/myapplication
/app
/controller
/view
app.js
/extjs-4.1.1
Run Code Online (Sandbox Code Playgroud)
app.js文件包含:
Ext.Loader.setConfig({
enabled: true
});
Ext.application({
appFolder: '/myapplication/app',
autoCreateViewport: true,
name: 'MyApplication',
controllers: [
...
]
});
Run Code Online (Sandbox Code Playgroud)
一切都很好.然后我将app.js包含在我的服务器端 MVC应用程序中输出(不要与客户端 Ext JS MVC结构混淆).使用的语言和服务器端应用程序的结构对于这个问题并不重要,但输出的结果是.在开发中,应用程序的URL是:
http://servername/someidentifier1/someidentifier2
Run Code Online (Sandbox Code Playgroud)
与许多应用程序一样,mod_rewrite用于赋予标识符含义并将URL映射到服务器端代码.这些标识符不映射到"物理"目录.此URL的输出是:
<!DOCTYPE html>
<html>
<head>
<title>MyApplication</title>
<link href="/extjs-4.1.1/resources/css/ext-all-debug.css" media="screen" rel="stylesheet" type="text/css" >
<script type="text/javascript" src="/extjs-4.1.1/ext-debug.js"></script>
<script type="text/javascript" src="/myapplication/app.js"></script>
</head>
<body>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
Ext JS的是不是在默认的推荐位置,是/wwwroot/myapplication/extjs-4.1.1,而是一个级别,因为它在多个应用程序之间共享.如果您回顾上面的app.js,您还会注意到需要设置的appFolder设置,以便使用"不存在"的URL.
这一切都可以在开发中正常工作,但下一步是使用Sencha SDK Tools生成代码的"构建" (问题基于适用于Windows的2.0.0 Beta 3版本).这是它出错的地方.我采取以下步骤:
sencha create jsb -a …在我们的应用程序中,您可以通过搜索来自多个第三方来源的选项来构建问题.大多数搜索结果都显示为全宽的tableview单元格,因为它们的数据适合该格式(我可以在缩略图旁边显示一堆元数据文本).
然而,在图像的情况下,集合视图更有意义.但是现在我遇到了包含垂直滚动集合视图的垂直滚动tableview的问题.
http://www.screencast.com/t/7Z48zkkW
我可以通过捕获viewDidScroll集合视图并在适当的偏移处更新父卷轴视图来使其工作,但只有在用户主动拖动集合视图时才能正常工作.
self.collectionVC.scrollViewDidScroll = ^(UIScrollView *scrollView) {
@strongify(self);
if (self.tableView.contentOffset.y < self.scrollingHeightOffset && scrollView.contentOffset.y > 0) {
CGFloat maxheight = MIN(self.scrollingHeightOffset, self.tableView.contentOffset.y + scrollView.contentOffset.y);
self.tableView.contentOffset = CGPointMake(0, maxheight);
scrollView.contentOffset = CGPointMake(0, 0);
} else if (scrollView.contentOffset.y < 0 && self.tableView.contentOffset.y > -topGuide) {
CGFloat minheight = MAX(-topGuide, self.tableView.contentOffset.y + scrollView.contentOffset.y);
self.tableView.contentOffset = CGPointMake(0, minheight);
scrollView.contentOffset = CGPointMake(0, 0);
}
};
Run Code Online (Sandbox Code Playgroud)
当"投掷"集合视图时,滚动突然停止,失去了集合视图的惯性.触摸tableview进行滚动会产生一个不同的问题,因为当它到达结尾并滚动集合视图时我没有捕获它.
现在,集合视图存在于tableview的单元格中,但如果需要,它也可以是对等体.我正在尝试确定使这两个滚动视图显示为一个的最佳方法.
extjs ×4
extjs4 ×4
extjs4.1 ×2
ios ×2
javascript ×2
model ×2
cocoa-touch ×1
constructor ×1
cordova ×1
extjs-mvc ×1
field ×1
grid ×1
html ×1
ios5 ×1
iphone ×1
json ×1
mobile ×1
proxy ×1
sencha-touch ×1
sqlite ×1
swift ×1
uiscrollview ×1