小编jb1*_*785的帖子

Sublime Text 2代码段

我昨天刚开始使用Sublime Text 2,我很喜欢它.但是,我正在尝试设置一个我会一直使用的代码片段.问题是编辑根本没有认识到它.我把它保存在我的Packages/User文件夹中.该片段如下:

<snippet>
    <content><![CDATA[echo "<pre>".print_r(${0:var},true)."</pre>";]]></content>
    <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
    <tabTrigger>pre</tabTrigger>
    <!-- Optional: Set a scope to limit where the snippet will trigger -->
    <scope>source.php</scope>
    <description>print r with pre tags</description>
</snippet>
Run Code Online (Sandbox Code Playgroud)

知道我做错了什么吗?

sublimetext

7
推荐指数
1
解决办法
4888
查看次数

在sencha touch 2中动态加载列表

我有一个设置了卡片布局的Sencha Touch 2.0应用程序.它包含一个仪表板,其中包含用户可以单击的图标和一个客户列表(xtype:'list').当应用程序加载时,我加载应用程序中的所有"卡",包括客户列表,但我不加载数据(通过代理),除非设置了localStorage变量.加载完所有内容后,我会通过检查localStorage变量来检查用户是否应该自动登录.如果他们自动登录,那么我的应用程序可以正常运行 如果他们不是我给他们显示"登录"卡,这基本上是一个登录表格.一旦他们提交此登录表单,我就会执行ajax调用.如果这回来正确,我将它们发送到"仪表板"卡.但在此之前,我正试图通过ajax调用加载客户列表:

var tmpId = { id: example.id };

var cListStore = Ext.create('example.store.CustomerList');
cListStore.getProxy().setExtraParams(tmpid);
cListStore.load();
Run Code Online (Sandbox Code Playgroud)

使用上面的代码,我可以看到我的代理调用正在发生,我可以看到响应是正确的.但是,当我看到仪表板,然后单击"客户"图标时,我看到一个空列表.我的工具栏就在那里,甚至我列表上的indexBar就在那里,只是没有数据.我不确定我在这里做错了什么.我在下面列出了我的列表视图,商店和模型,希望这将有助于任何看过这个的人:

Ext.define('example.view.CustomerList', {
    extend: 'Ext.Container',
    id: 'customerListContainer',
    xtype: 'customerlist',
    config: {
        layout: 'fit',
        items: [{
            xtype: 'toolbar',
            docked: 'top',
            title: 'Customers',
            items: [{
                xtype: 'button',
                text: 'Home',
                id: 'customerListHomeButton',
                ui: 'back'
            }]
        }, {
            xtype: 'list',
            itemTpl: '<div class="contact">{first_name} <strong>{last_name}</strong>  </div>',
            store: 'CustomerList',
            id: 'customer_list',
            grouped: true,
            indexBar: true
        }]
    }
});

Ext.define('example.store.CustomerList', {
    extend: 'Ext.data.Store',
    id: 'customerListStore',
    requires: ['example.model.CustomerList'],
    config: {
        model: …
Run Code Online (Sandbox Code Playgroud)

sencha-touch sencha-touch-2

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

sencha-touch ×1

sencha-touch-2 ×1

sublimetext ×1