摘要: sencha touch 2.2 list PullRefresh插件没有refreshFn方法但是我们又需要他,所以需要自行扩展代码如下 1 /** 2 * 重写下拉刷新插件,以支持refreshFn事件 3 */ 4 Ext.define('ux.plugin.RefreshFn', { 5 extend: 'Ext.plugin.PullRefresh', 6 alias: 'plugin.refreshFn', 7 requires: ['Ext.DateExtras'], 8 xtype:'refreshFn&# 阅读全文
posted @ 2013-12-06 14:39 魔狼再世 阅读(1211) 评论(0) 推荐(0)
摘要: 1.使用命令生成项目例:cordova create jy110 com.example.jy110 jy1102.使用命令添加插件(如果报错,可能是网络问题,可以多试几次,直到成功)例:cordova plugin add org.apache.cordova.inappbrowser3.检查插件是否安装成功例:cordova plugin ls['org.apache.cordova.inappbrowser']4.生成安卓项目例:cordova platform add android如图:在assets\www文件加中会如下生成:我们要整合sencha-touch进来, 阅读全文
posted @ 2013-11-27 12:24 魔狼再世 阅读(1758) 评论(1) 推荐(1)
摘要: cordova最新中文apihttp://cordova.apache.org/docs/zh/3.1.0/1、将Cordova 生成的项目导入到adt-eclipse中,如下:项目结构如下: 导入之后可能报以下错误:解决方案:1.右击项目选择 properties2.选择android. 设置AP... 阅读全文
posted @ 2013-11-22 14:02 魔狼再世 阅读(3681) 评论(1) 推荐(0)
摘要: 参考资料:http://www.cnblogs.com/qqloving/archive/2013/04/25/3043606.htmlhttp://www.admin10000.com/document/140.html这里我主要讲的是如何加入全局变量、公用类、自定义扩展、资源文件官网地址:htt... 阅读全文
posted @ 2013-11-13 10:42 魔狼再世 阅读(9862) 评论(5) 推荐(2)
摘要: 凡是Cannot call method '' of undefined 这类错误大部分都可以参照下面的办法来解决在st中有时候你会发现使用Ext.Ajax.request会出现一下错误:Cannot call method 'request' of undefined出现以上错误的原因是Ext.Ajax这个组件没有被注册解决方案:1.一般来说你只要在控制层或者app.js注册引用了model、store,st就会自动注册主键代码如下: 1 /* 2 *列表控制 3 */ 4 Ext.define('app.controller.List', { 阅读全文
posted @ 2013-11-09 10:43 魔狼再世 阅读(1155) 评论(0) 推荐(0)
摘要: 有时候内容直接从后台获取,有可能包含超链接,打包成应用之后,点击会造成不好的后果,这样做能够用外部浏览器打开。需要Cordova支持监听插件代码: 1 /* 2 *监听a标签,用外部浏览器打开链接 3 */ 4 Ext.define('ux.ConHref', { 5 alias: 'plugin.conHref', 6 xtype: 'conHref', 7 config: { 8 cmp: null, 9 //竖向滚动,不显示滚动条10 scrollable: {11 direction: 'v... 阅读全文
posted @ 2013-11-07 14:50 魔狼再世 阅读(783) 评论(0) 推荐(0)
摘要: 需要添加自定义事件可以如下: this.fireEvent('back', this);此方法第一个参数为你想要监听的事件,之后的参数为你想要传递的参数一般来说第一个参数最好是控件本身。同理这个方法也可以用来触发控件本身的事件,不过其中传递的参数必须完整,也就是api中提到的参数。如何获取这些参数可以参考控件源码如果想要触发一个指定的方法,可以这样:this.fireAction('onBack',this);这种写法的好处是知道的方法不一定需要存在,不存在也不会出错。会自动返回false还有一种写法可以监听事件同时也触发方法:this.fireAction(& 阅读全文
posted @ 2013-10-29 10:06 魔狼再世 阅读(879) 评论(1) 推荐(0)
摘要: 基于sencha touch 2.2所写代码: 1 /* 2 *模仿tabpanel导航栏 3 */ 4 Ext.define('ux.TabBar', { 5 alternateClassName: 'tabBar', 6 extend: 'Ext.Toolbar', 7 xtype: 'tabBar', 8 config: { 9 docked: 'bottom',10 cls: 'navToolbar',11 layout: {12 align: 'stretch'13 ... 阅读全文
posted @ 2013-10-24 15:02 魔狼再世 阅读(1083) 评论(0) 推荐(0)
摘要: 1 var animation = this.getLayout().getAnimation();2 //添加监听3 animation.on({4 scope: this,5 animationend: 'onAnimationend',//动画效果开始6 animationstart: 'onAnimationstart'//动画效果结束7 }); 阅读全文
posted @ 2013-10-23 20:29 魔狼再世 阅读(827) 评论(0) 推荐(0)
摘要: 在sencha touch2.2中采用card布局之前的需求是考虑show,hide事件发现不可取http://www.cnblogs.com/mlzs/archive/2013/06/13/3134162.html假设有home,list,info三个界面,监控list的activate,deactivate事件视图展示顺序为home-》list-》info切父容器为NavigationView从home进入到list,会触发activate事件从list返回到home,会触发deactivate事件从info返回到list,会触发activate事件基本上能满足一定的需求。不过值得注意的是 阅读全文
posted @ 2013-10-22 18:04 魔狼再世 阅读(1058) 评论(0) 推荐(0)
摘要: 这是一个开源示例,是我对sencha touch的深层应用。已停止更新sencha touch版本:2.2.1/2.3.1源码地址:https://bitbucket.org/moLangZaiShi/demo/downloads有两个分支,master是旧的2.2.1版本,示例比较全。demo_2... 阅读全文
posted @ 2013-10-22 13:09 魔狼再世 阅读(7374) 评论(9) 推荐(1)
摘要: 1 Ext.define('Ext.navigation.View', { 2 extend: 'Ext.Container', 3 alternateClassName: 'Ext.NavigationView', 4 xtype: 'navigationview', 5 requires: ['Ext.navigation.Bar'], 6 config: { 7 /** 8 * @cfg 9 * @inheritdoc 10 */ 11 baseCl... 阅读全文
posted @ 2013-10-18 16:57 魔狼再世 阅读(1661) 评论(0) 推荐(0)
摘要: model 1 Ext.define('app.model.Register', { 2 extend: 'Ext.data.Model', 3 requires: ['Ext.data.JsonP'], 4 config: { 5 fields: [{ 6 name: 'mobile', 7 type: 'int' 8 }, 9 {10 name: 'verifycode',11 type: 'int'12 }... 阅读全文
posted @ 2013-09-26 17:16 魔狼再世 阅读(1378) 评论(0) 推荐(0)
摘要: 使用路由的时候可以传递参数如下:index.html#eaterylist/335/61/61/61/B/商户名称其中6个参数依次是:商户编号/公众账号/微信号/校验号/服务类型/商户名称因为最后一个参数是中文,所以普通写法获取不到中文参数,也不能激活路由. routes: { 'eatery/:mCode/:pAccount/:mSignal/:cNo/:tService/:bName': 'showEatery' }经过一番试验,以下写法可以获取到中文参数并且激活路由 routes: { 'eatery/... 阅读全文
posted @ 2013-09-23 16:29 魔狼再世 阅读(1411) 评论(0) 推荐(2)
摘要: 参考资料:http://www.cnblogs.com/numtech/p/3233469.htmlhttp://blog.sina.com.cn/s/blog_9e245c690101jurr.htmlhttp://roger-588.iteye.com/blog/785682需要eclipse、... 阅读全文
posted @ 2013-09-21 21:37 魔狼再世 阅读(4355) 评论(4) 推荐(0)
摘要: 参考资料:https://market.sencha.com/extensions/datetimepicker上面的扩展在2.2有些问题,参考源码重新写了一个TimePicker: 1 Ext.define('ux.TimePicker', { 2 extend: 'Ext.picke... 阅读全文
posted @ 2013-09-16 17:32 魔狼再世 阅读(2840) 评论(0) 推荐(0)
摘要: 示例代码: 1 Ext.define('app.view.message.List', { 2 alternateClassName: 'messageList', 3 extend: 'Ext.List', 4 xtype: 'messageList', 5 requires: ['Ext.plugin.ListPaging'], 6 config: { 7 cls: 'list', 8 plugins: [{ 9 xclass: 'Ext.plugin.ListPaging'10 阅读全文
posted @ 2013-09-16 10:55 魔狼再世 阅读(1949) 评论(0) 推荐(0)
摘要: http://www.cnblogs.com/mlzs/p/3317570.html如此章所说,点击按钮需要实时更新视图操作代码如下: 1 onTasteUp: function (list, record, item, index, btn) { 2 var visibility = 'visible', 3 value = +btn.getAttribute("value"), 4 data = record.data, 5 taste = data.taste + value, 6 eateryBar... 阅读全文
posted @ 2013-09-15 00:07 魔狼再世 阅读(932) 评论(1) 推荐(0)
摘要: 插件代码 1 /* 2 *list tpl模版加入按钮监控 3 * 4 *fire="showWeibo" 作用是激活指定事件 5 *有两个参数cmp:视图本身以及doit 6 *只要是以上格式的模板都可以被监控到 7 *其中btn、lower为自定义样式,其他都是st自带样式 8 */ 9 Ext.define('ux.ListTpl', {10 alias: 'plugin.ListTpl',11 xtype: 'listTpl',12 config: {13 list: null,14 //按下时添加css15 pr.. 阅读全文
posted @ 2013-09-12 18:40 魔狼再世 阅读(1811) 评论(0) 推荐(0)
摘要: sencha touch 2.2.1 这个版本使用了新的按钮模式,不过他只提供了少部分的按钮样式。我们可以加一些自定义的ico样式新加ico样式lower 1 .x-button .x-button-icon.lower:before { 2 position:absolute; 3 top:0; 4 right:0; 5 bottom:0; 6 left:0; 7 text-align:center; 8 font-family:"Pictos"; 9 content:"_";10 }以在list中使用示例Ext.define(... 阅读全文
posted @ 2013-09-10 19:03 魔狼再世 阅读(1265) 评论(0) 推荐(0)