1
點擊一個按鈕,打開一個窗口,其中有一個窗體面板和一個網格。在表單中我有一些組合框,文本框和一個提交按鈕。點擊提交按鈕後,它應該聯繫數據庫並獲取值,然後填充網格列。對於特定的作業ID,我們只能從數據庫中獲得一組值。對於閱讀數據庫查詢,我使用的是「Ext.data.CFQueryReader」。現在我收到一個錯誤「Ext.data.CFQueryReader不是構造函數」。 由於我對ext js非常陌生,因爲我一直在利用其他模塊中使用的代碼,所以我不確定代碼流。所以我的代碼會有一些差距。 請在此建議我。以下是我用於此頁面的代碼片段。如果有其他簡單的方法,請告訴我。 我不確定我們是否需要這裏的分頁工具欄。如果不使用pagingtoolbar,我們如何獲取值?Ext.data.CFQueryReader不是構造函數錯誤
var filterForm = new Ext.form.FormPanel({
title : 'Filters',
floatable : false,
id : 'filterForm',
items : [
{
xtype : 'combo',
id :'Combo1',
fieldLabel :'Owner',
valueField :'ownerValue',
displayField :'ownerDisplay',
value :'ALL'
},
{
xtype : 'combo',
id :'Combo2',
fieldLabel :'Status',
valueField :'statusValue',
displayField :'statusDisplay',
value :'ALL'
},
{
xtype : 'textfield',
fieldLabel : 'job Search',
width : 200,
id :'searchText'
}
],
buttons: [
{
text : 'Apply Filter(s)',
id : 'apply',
handler : function(){
loadJobs();
}
}
]
});
var filterGrid = new Ext.grid.GridPanel({
title : 'List',
id : 'list',
store : listStore,
columns: [
{
header : 'JOBID',
width : 70,
dataIndex : 'jobid',
sortable : true
},
{
header : 'Description',
id : 'description',
dataIndex : 'description',
},
{
header : 'Category',
dataIndex : 'category',
width : 100
}
]
});
function loadJobs()
{
pagingToolBar.displayMsg = "Displaying {0} - {1} of {2}";
listStore.baseParams.jobid = '';
pagingToolBar.changePage(1);
}
var pagingToolBar = new Ext.PagingToolbar({
pageSize : 20,
id : 'pagingToolbar',
store : listStore,
displayInfo : true,
displayMsg : 'Displaying jobs {0} - {1} of {2}'
});
var listStore= new Ext.data.Store({
url : "/list.cfc",
method : 'POST',
reader : listReader,
baseParams : {
method : 'fetchList',
returnFormat : 'json',
owner : 'ALL',
status : 'ALL',
jobidSearch : '',
jobid : ''
},
listeners : {
beforeload : function(store,options){
store.baseParams.email = Ext.getCmp('Combo1').getValue();
store.baseParams.status = Ext.getCmp('Combo2').getValue();
store.baseParams.idSearch =Ext.getCmp('searchText').getValue();
}
}
});
var listReader = new Ext.data.CFQueryReader(
{
id : 'jobid',
totalProperty : 'TOTALROWCOUNT'
},
[
{ name : 'jobid',mapping : 'JOBID',type : 'string'},
{ name : 'description',mapping : 'DESCRIPTION',type : 'string'},
{ name : 'category',mapping : 'CATEGORY',type :'string'}
]
);
感謝解決this.I想到的Ext JS庫這將部分本身,所以我沒加這個特定庫 – user1049057 2012-03-02 06:05:47
我很高興加入Pentaho的閱讀器的路徑有效。請記住,無論何時發生此特定錯誤,都意味着extjs無法找到您的.js文件或名稱不正確。 – Shekhar 2012-03-02 11:29:49