Results 1 to 2 of 2

Thread: Ext.data.CFQueryReader is not a constructor error

  1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    30

    Default Ext.data.CFQueryReader is not a constructor error

    On Click of a button, opens a window in which i have a form panel and a grid. Within the form I have some combo boxes, text box and a submit button. On clicking the submit button it should contact the database and get the values and then populate the grid columns. For a particular job id, there will be only one set of values that we get form the database.For reading the database query I am using "Ext.data.CFQueryReader". Now I am getting an error "Ext.data.CFQueryReader is not a constructor". Since I am very new to ext js I am not sure of the code flow as I have been leveraging the code which is used in other module. So there will be some gaps in my code. Please advice me on this. Below is the code snippet I am using for this page. Please advice me if there is any easy method other than this. I am not sure if we require pagingtoolbar here. If pagingtoolbar is not used, how can we get the values and display in the grid?

    Code:
    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'}        
       ]
    );
    Last edited by tobiu; 1 Mar 2012 at 4:40 AM. Reason: use code tags!

  2. #2
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,751
    Answers
    130

    Default

    Ext.data.CFQueryReader is not a class of the ext js framework. So, if you are trying to instanciate it, make sure the reader is defined and included.
    Best regards
    Tobias Uhlig

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •