te')); return $arr; } /* 遍历用户所有主题 * @param $uid 用户ID * @param int $page 页数 * @param int $pagesize 每页记录条数 * @param bool $desc 排序方式 TRUE降序 FALSE升序 * @param string $key 返回的数组用那一列的值作为 key * @param array $col 查询哪些列 */ function thread_tid_find_by_uid($uid, $page = 1, $pagesize = 1000, $desc = TRUE, $key = 'tid', $col = array()) { if (empty($uid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('uid' => $uid), array('tid' => $orderby), $page, $pagesize, $key, $col); return $arr; } // 遍历栏目下tid 支持数组 $fid = array(1,2,3) function thread_tid_find_by_fid($fid, $page = 1, $pagesize = 1000, $desc = TRUE) { if (empty($fid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('fid' => $fid), array('tid' => $orderby), $page, $pagesize, 'tid', array('tid', 'verify_date')); return $arr; } function thread_tid_delete($tid) { if (empty($tid)) return FALSE; $r = thread_tid__delete(array('tid' => $tid)); return $r; } function thread_tid_count() { $n = thread_tid__count(); return $n; } // 统计用户主题数 大数量下严谨使用非主键统计 function thread_uid_count($uid) { $n = thread_tid__count(array('uid' => $uid)); return $n; } // 统计栏目主题数 大数量下严谨使用非主键统计 function thread_fid_count($fid) { $n = thread_tid__count(array('fid' => $fid)); return $n; } ?>javascript - ExtJS 5 requests file with empty name .js - Stack Overflow
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - ExtJS 5 requests file with empty name .js - Stack Overflow

programmeradmin4浏览0评论

I've made a fresh workspace with the latest sencha cmd 5.0.2.270 and latest ExtJS 5.0.1. Generated an app into in. Wrote a little bit of code.

I generate production build with sencha app build.

The development loads well, but the production build tries to load file with no name and gets a 404

GET /.js?_dc=1410352524548 404 (Not Found) After that error it doesn't load at all.

I can't understand what it is searching for. Development is not plaining at all.

I made an archive with it !Dk0gDRJD!dNITsq1fGFs5T4d-4yYFnA6_K6EcAhFkxoeEjaJu7MY (~600kb). It includes the sources and the production build.

UPD I've found the place where it starts to break. In file RadioAdminController.js.

 case 'menu_referals':
    return app.setSubView('redmed-radioapp-referals', {
      store: Ext.create('RedmedAdmin.store.Referals')
    });

If I do not create a store - it works. The production build is ok. The store is nothing special:

Ext.define('RedmedAdmin.store.Referals', {
  extend: 'Ext.data.Store',
  model: 'RedmedAdmin.model.Referal',
  autoLoad: false,
  autoSync: true
});

I've made a fresh workspace with the latest sencha cmd 5.0.2.270 and latest ExtJS 5.0.1. Generated an app into in. Wrote a little bit of code.

I generate production build with sencha app build.

The development loads well, but the production build tries to load file with no name and gets a 404

GET http://yassa-built.dev/.js?_dc=1410352524548 404 (Not Found) After that error it doesn't load at all.

I can't understand what it is searching for. Development is not plaining at all.

I made an archive with it https://mega.co.nz/#!Dk0gDRJD!dNITsq1fGFs5T4d-4yYFnA6_K6EcAhFkxoeEjaJu7MY (~600kb). It includes the sources and the production build.

UPD I've found the place where it starts to break. In file RadioAdminController.js.

 case 'menu_referals':
    return app.setSubView('redmed-radioapp-referals', {
      store: Ext.create('RedmedAdmin.store.Referals')
    });

If I do not create a store - it works. The production build is ok. The store is nothing special:

Ext.define('RedmedAdmin.store.Referals', {
  extend: 'Ext.data.Store',
  model: 'RedmedAdmin.model.Referal',
  autoLoad: false,
  autoSync: true
});
Share Improve this question edited Sep 11, 2014 at 5:24 Maxym asked Sep 10, 2014 at 17:29 MaxymMaxym 6795 silver badges11 bronze badges
Add a ment  | 

5 Answers 5

Reset to default 4

On the fourth day of struggling a simple answer revealed.

I've missed one dependency. The chain: RedmedAdmin.store.Referals -> RedmedAdmin.model.Referal -> RedmedAdmin.model.redmed.RadioAppBase.

As I provided the archive, I will list class RedmedAdmin.model.redmed.RadioAppBase here (working version):

Ext.define 'RedmedAdmin.model.redmed.RadioAppBase',
    extend: 'Ext.data.Model'
    requires: ['Ext.data.identifier.Uuid', 'Ext.data.proxy.Rest']

    identifier: 'uuid'
    fields: [{
            name: 'id'
            type: 'string'
    }]
    schema:
            namespace: 'RedmedAdmin.model.redmed.radioapp'
            proxy:
                    type: 'rest'
                    url: 'http://10.0.29.140:6543/api/rest/{entityName:lowercase}'
                    reader:
                        type: 'json'
                        rootProperty: '{entityName:lowercase}'
                    listeners:
                        'exception': (request, operation, eOpts ) ->
                            Ext.log {level: 'error'}, "Data request to #{request.url} failed. Reply: #{operation.responseText}"

It defines a schema for all children. The schema uses rest proxy (type: 'rest'). It wasn't included in the broken version. Only Ext.data.identifier.Uuid was listed in requires.

Run the app from build/testing/ to see which dependency is missing.

I had the same problem before and the fix was to add required Ext.layout.container.Border' & 'Ext.layout.container.Center'. I had to manually ment out codes & run the production build to check (since it works fine in developement mode). In some cases, it would point out the the missing dependencies like widget/...js

This problem is related to classes need to be added in the requires array. I ran the build using Sencha app build testing then in the debug I cam to know which class was loading empty. To resolve my problem I have added Ext.layout.container.Column but it can be any class, so its better to run the build in testing then identify the problem.

In order to get these configuration properties to work properly, you need to add this 'Ext.data.identifier.Uuid' class as project level.

Include Ext.data.identifier.Uuid as requires in the Ex.Application app.js file

Ext.application({

    requires: [
        'Ext.data.identifier.Uuid' // Include it
    ],
    models: [
        'UsersModel',
        'RolesModel',
        'LoginModel'
    ]

    .
    .
    .
    .

});
发布评论

评论列表(0)

  1. 暂无评论