【发布时间】:2012-07-26 14:57:33
【问题描述】:
我正在学习煎茶触摸。我之前用表单创建了这个应用程序,它运行良好。
现在我正在开发一个新的小测试应用程序,我从另一个应用程序复制代码,它只将空变量传递给网络服务。
视图:
<!-- language: lang-js -->
Ext.define('Gasoline.view.InsertTankTrip', {
requires: [
'Ext.form.FieldSet'
],
extend: 'Ext.form.Panel',
xtype: 'inserttankpanel',
id: 'insertTankForm',
config: {
title: 'Insert Tank Trip',
iconCls: 'add',
url: 'contact.php',
items:[
{
xtype: 'fieldset',
title: 'Insert Tank Trip',
instructions: '(Make sure the info is correct!)',
items:[
{
xtype: 'datepickerfield',
label: 'Date',
name: 'date',
value: new Date()
},
{
xtype: 'textfield',
label: 'Amount',
name: 'amount',
minValue:-9007199254740992,
maxValue: 9007199254740992
}
]
},{
xtype: 'button',
text: 'Send',
ui: 'confirm',
action: 'insertTankSubmit'
}
]
}
});
在控制器中:
launch: function() {
// Destroy the #appLoadingIndicator element
Ext.fly('appLoadingIndicator').destroy();
// Initialize the main view
Ext.Viewport.add(Ext.create('Gasoline.view.Main'));
this.control({
'button[action=insertTankSubmit]' : {
tap: 'insertTankForm'
}/*,
'list[itemId=kingsLeagueList]' : {
itemtap: 'onListTap'
},
'list[itemId=tournamentsList]' : {
disclose: 'showDetail'
}*/
});
},
insertTankForm : function(){
console.log('test');
var form = this.getInsertTankForm();
form.submit({
url:'contact.php'
});
},
这会将以下内容发送到网络服务(目前不存在,我只是用开发人员工具检查)
日期:2012-07-26T17:02:16 金额:
所以确实发送了日期,但没有发送数字
如果我为发送的数字填写标准值......但如果你输入一些东西,它仍然不会发送那个
【问题讨论】:
标签: sencha-touch extjs sencha-touch-2