缺少:属性ID后Ext.ux.grid.RowExpander = function(){

时间:2013-04-24 15:11:14

标签: javascript extjs

好的,所以我花了几个小时梳理这段代码,但仍无法找到这个错误产生的地方。 Firefox控制台向我显示的错误是在第5行的第7行找到了这个缺少的冒号。有人可以帮助一个女孩吗?先感谢您。

Ext.Loader.setConfig({
enabled: true
});

Ext.application( {
controllers: [ "Links" ],
    Ext.ux.grid.RowExpander: function() {
        var expanderVariableScopes = new Ext.ux.grid.RowExpander({
                tpl: new Ext.XTemplate(
'<p><span class="boldText" style="text-decoration: underline;">Form Scope</span><ul style="padding:0 0 0 5px;">',
'<tpl for="form_scope"><li><span class="boldText">{key}:</span> {value}</li></tpl>',
'</ul></p><br />',
'<p><span class="boldText" style="text-decoration: underline;">URL Scope</span><ul style="padding:0 0 0 5px;">',
'<tpl for="url_scope"><li><span class="boldText">{key}:</span> {value}</li></tpl>',
'</ul></p>'
                )
 }),
paginator: new YAHOO.widget.Paginator({
     containers: [ 'sessionPaginator' ],
     initialPage: $('#session-initial-page').val(),
     rowsPerPage: $('#session-rows-per-page').val(),
     totalRecords: $('#session-total-records').val()
});
storeAccessLog: new Ext.data.Store({
    baseParams: { limit: 25, method: 'account_session_access_log' },
    proxy: new Ext.data.HttpProxy({
        disableCaching: true,
        method: "GET",
        url: "ajax/account.cfc"
    }),
    reader: new Ext.data.JsonReader({
        root: "DATA",
        totalProperty: "META.totalRecords",
        fields: [ 'log_id', 'cdate', 'session_id', 'request_type', 'filename', 'user_agent', 'form_scope', 'url_scope', 'account_id', 'accountholder' ]
    }),
    remoteSort: true,
    sortInfo: {
        field: 'cdate',
        direction: 'DESC'
    }
}),
storeAuditEntries: new Ext.data.Store({
    baseParams: { method: 'session_audit_entries' },
    proxy: new Ext.data.HttpProxy({
        disableCaching: true,
        method: "GET",
        url: "ajax/account.cfc"
    }),
    reader: new Ext.data.JsonReader({
        root: "DATA",
        totalProperty: "META.totalRecords",
        fields: [ 'AUDIT_TEXT', 'AUDIT_DATETIME' ]
    })
}),

$(window).resize(function() {
oWindow.center();   
});

 paginator.subscribe("changeRequest", function (newState) {
            window.location.href = "accounts-view-activity.cfm?#request.qString#&sort=#url.sort#&dir=#url.dir#&initialPage=" + newState.page;
        });

paginator.render();

$('.detailslink')
.button({
    icons: { primary: 'ui-icon-plusthick' },
    text: false
 })
.click(function (e) {
    var $this = $(this);

    storeAccessLog.extraParams("session_id", $this.val());
    storeAccessLog.load({ params: { start: 0 } });

    storeAuditEntries.extraParams("session_id", $this.val());
    storeAuditEntries.load();

    oWindow.show()
});

$('#accountForm').submit(function(e) {
    e.preventDefault();
});
name: "SPOT"
}); 

1 个答案:

答案 0 :(得分:0)

问题是您使用=运算符,而您应该使用:运算符。

当您按照上面的方式定义对象时,预期的语法是:

var obj = {
    prop1: value1,
    prop2: value2
    ...
};

在你的情况下,

Ext.ux.grid.RowExpander = function() {应更改为Ext.ux.grid.RowExpander: function() {

paginator = new YAHOO.widget.Paginator({应更改为paginator: new YAHOO.widget.Paginator({

依旧......