2013-04-24 39 views
0

好吧,所以我花了幾個小時梳理這段代碼,仍然無法找到從哪裏產生這個錯誤。 Firefox控制檯顯示的錯誤是,第5行的第7行顯示了這個遺漏的冒號。有人可以幫助一個女孩出來嗎?先謝謝你。缺少:屬性ID後Ext.ux.grid.RowExpander = function(){

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" 
}); 

回答

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({

等等。

+0

在哪一行應將=操作符更改爲: – user1967776 2013-04-24 15:17:21

+0

您的'Ext.application(..)'調用需要一個對象。該對象的屬性應該定義爲'keyName:Value'。我在答案中給出了2個示例修正點。 – techfoobar 2013-04-24 15:18:29

+0

我做了建議的更改,但仍然收到相同的錯誤消息。 – user1967776 2013-04-24 15:25:49