1. #11
    Ext User
    Join Date
    May 2010
    Posts
    6
    Vote Rating
    0
    PatJ is on a distinguished road

      0  

    Default


    Thanks for responding. I made the changes you suggested. Results are the same. I looked at the JSON output again and I noticed that there are several NULL fields attached to the end of it. I didn't notice that before. I'm not able to use the file upload manager, possibly because I'm behind a firewall? Anyway, I am pasting all three files: test.cfm, test.cfc, and test3.js for your review:


    ---------------------------------------------------
    JSON output from test2.cfm

    {"TOTALROWCOUNT":12,"QUERY":{"COLUMNS":["WADID","TITLE"],"DATA":[[45000,"Adding instrumentations to monitor flowrate, temperatures and KW readings of the new 700 HP compressor "],[45001,"Remove tombstone & install new wall receptacle"],[45002,"Upgrade Refrigerant Storage Systems "],[45003,"E267 Install Burglar Bars on West Wendow outside of fence "],[45004,"Install Backup Generator for Child Care Center "],[45005,"Perform design for Third Street\/P. Lot C-3 paving "],[45006,"Install Electrical Power EOC - Room 3118 "],[45007,"Clean and Touch-Up Paint Chamber A 40 Ft Door"],[45009,"Conference Room Upgrade "],[45010,"Install Sound Soak & Chairs Rails on Walls of Video Lab and Classroomss"],[45011,"Add 20 AMP power to B1\/378 for redundant router installation "],[47072,"ReRoof Building 48 "],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null],[null,null]]}}

    Here is the output from Firebug:

    Store count = 0
    b is null



    ---------------------------------------------------
    test2.cfm

    <html>
    <head>
    <title>test page 2</title>
    <cfinclude template="_css_jslibs.cfm">
    <script type="text/javascript" src="ext/CFQueryReader/js/custom/CFQueryReader.js"></script>
    <script type="text/javascript" src="ext/examples/ux/PanelResizer.js"></script>
    <script type="text/javascript" src="ext/examples/ux/SlidingPager.js"></script>
    <script type="text/javascript" src="js/ext/test3.js"></script>
    </head>
    <body>
    <cfoutput>
    <cfinvoke component="cfcs.test" method="getwads" returnVariable="wadlist" page="1" pagesize="50" />

    #SerializeJSON(wadlist)#
    <div id="gridtest"></div>
    </cfoutput>
    </body>
    </html>

    ---------------------------------------------------
    NOTE: the _css_jslibs.cfm file noted above includes the other ExtJS libraries:
    <link href="css/wadapp.css" rel="stylesheet" type="text/css" />
    <link href="css/wadmenu.css" rel="stylesheet" type="text/css" />

    <script src="js/common.js" type="text/javascript"></script>
    <script src="js/sort_it.js" type="text/javascript"></script>
    <script src="js/xpath.js" type="text/javascript"></script>
    <!--- ExtJS calls --->
    <!--- these are required to be in the library as provided, do not re-locate --->
    <!-- CSS base library -->
    <link rel="stylesheet" type="text/css" href="ext/resources/css/ext-all.css" />
    <!-- overrides to CSS base library --->
    <link rel="stylesheet" type="text/css" href="ext/examples/ux/css/Portal.css" />
    <link rel="stylesheet" type="text/css" href="ext/examples/menu/menus.css" />
    <link rel="stylesheet" type="text/css" href="ext/examples/shared/examples.css" />
    <!--- <link rel="stylesheet" type="text/css" href="css/ext/tabs-example.css" /> --->
    <!-- ExtJS library: base/adapter -->
    <script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script>
    <!-- ExtJS library: all widgets -->
    <script type="text/javascript" src="ext/ext-all.js"></script>

    <!-- overrides to base library -->
    <!-- extensions -->
    <script type="text/javascript" src="ext/examples/ux/Portal.js"></script>
    <script type="text/javascript" src="ext/examples/ux/PortalColumn.js"></script>
    <script type="text/javascript" src="ext/examples/ux/Portlet.js"></script>
    <script type="text/javascript" src="ext/examples/shared/examples.js"></script>
    <!--- <script type="text/javascript" src="ext/examples/ux/TableGrid.js"></script> --->
    ---------------------------------------------------

    test.cfc

    <cfcomponent>
    <cffunction name="getwads" access="remote" output="false" returntype="any" returnformat="JSON">
    <cfargument name="page" type="numeric" required="yes">
    <cfargument name="pageSize" type="numeric" required="yes">
    <cfargument name="gridsortcolumn" type="string" required="no" default="">
    <cfargument name="gridsortdir" type="string" required="no" default="">

    <cfquery name="getwads" datasource="#request.dsn#">
    SELECT wadid, title
    FROM db_wad
    </cfquery>

    <cfreturn QueryConvertForGrid(getwads, page, pageSize) />
    <!--- <cfreturn getwads /> --->
    </cffunction>

    </cfcomponent>
    ---------------------------------------------------

    test3.js

    Ext.onReady(function(){
    var myDataModel = [
    { name: 'WADID', mapping: 'wadID', type: 'int' },
    { name: 'TITLE', mapping: 'Title', type: 'string' }
    ];
    var myCFReader = new Ext.data.CFQueryReader({id:'WADID'},myDataModel);
    var store = new Ext.data.Store({
    totalProperty: 'DATASET',
    root:'ROWS',
    proxy:new Ext.data.HttpProxy({
    method:'POST',
    url:'../../cfcs/test.cfc?method=getwads'
    }),
    id:'WADID',
    successProperty: 'SUCCESS',
    remoteSort:true,
    baseParams: { returnformat: 'JSON', start: '1', limit: '50'},
    reader: myCFReader
    });

    console.info('Store count = ', store.getCount());

    var grid = new Ext.grid.GridPanel({
    store: store,
    columns: [
    {id:'WADID',header: "WAD Number", width: 160, sortable: true, dataIndex: 'wadid'},
    {header: "Title", width: 75, sortable: true, dataIndex: 'title'}
    ],
    stripeRows: true,
    autoExpandColumn: 'title',
    height:320,
    width:600,
    frame:true,
    title:'Sliding Pager',

    plugins: new Ext.ux.PanelResizer({
    minHeight: 100
    }),

    bbar: new Ext.PagingToolbar({
    pageSize: 10,
    store: store,
    displayInfo: true,

    plugins: new Ext.ux.SlidingPager()
    })
    });

    grid.render('mygrid');

    store.load();

    });

  2. #12
    Ext JS Premium Member CutterBl's Avatar
    Join Date
    Aug 2007
    Location
    Nashville, TN
    Posts
    236
    Vote Rating
    0
    CutterBl is on a distinguished road

      0  

    Default


    Your JSON return is your problem. It expects your id field to be an int value, and bombs when finding those records with a 'null' value. Somehow you'll have to filter (at the SQL level) to only return records with value:

    Code:
    SELECT    wadid,
                  title
    FROM       db_wad
    WHERE     wadid IS NOT NULL
    --
    Steve "Cutter" Blades
    Adobe Community Professional - ColdFusion
    Adobe Certified Professional - Advanced Macromedia ColdFusion MX 7 Developer

    _____________________________
    Blog: Cutter's Crossing

    Co-Author "Learning Ext JS 3.2"

  3. #13
    Ext User
    Join Date
    May 2010
    Posts
    6
    Vote Rating
    0
    PatJ is on a distinguished road

      0  

    Default


    Thanks for the response. After I posted the last message I realized the additional NULLS were coming from "baseParams: { returnformat: 'JSON', start: '1', limit: '50'},". I didn't have 50 records only 12 (at the time). So I changed "start" to "page" and "limit" to "pageSize" which is the argument names in the cfc and changed the pageSize value to 5. We now have 15 records and the JSON return looks like this - returning the 5 records instead of all 15:

    {"TOTALROWCOUNT":15,"QUERY":{"COLUMNS":["WADID","TITLE"],"DATA":[[45000,"Adding instrumentations to monitor flowrate, temperatures and KW readings of the new 700 HP compressor "],[45001,"Remove tombstone & install new wall receptacle"],[45002,"Upgrade Refrigerant Storage Systems "],[45003,"E267 Install Burglar Bars on West Wendow outside of fence "],[45004,"Install Backup Generator for Child Care Center "]]}}

    The wadid field from the database is an "int" value. The store still does not load. I know the error I'm receiving is from the grid because there are no records in the store. I removed the call to the grid and I have no errors now - just store count = 0. I was also under the impression from reading CF documentation that you shouldn't have to send the "page" and "pageSize" parameters that these values are determined behind the scenes. I get the same "store count = 0" when I change the cfc to return a straight query using baseParams: { returnformat: 'JSON'},

    I may have to abandon the ExtJS framework idea for our application because another issue that I wasn't thinking about when I started down this path is whether the application as I've developed it so far is 508 compatible. I'm waiting for some folks to do a test run on it and see where I stand.

    If you can see any other issue as to why the store is not loading I'd appreciate some feedback!
    Thanks,
    Pat

  4. #14
    Ext JS Premium Member CutterBl's Avatar
    Join Date
    Aug 2007
    Location
    Nashville, TN
    Posts
    236
    Vote Rating
    0
    CutterBl is on a distinguished road

      0  

    Default


    508 compliance requires some additional coding on your part ARIA support. See the "Accessibility" Demos on the Samples & Demos page.

    I'm also trying to rectify your Store and Reader configuration with the data you're showing in your JSON return, and they don't jive. First, you identify your totalProperty as "DATASET", but you're JSON return shows it as "TOTALROWCOUNT". Second, you identify your root as "ROWS", when the root in your JSON return is "QUERY" (which should be automatically recognized without defining the root attribute with CFQueryReader). Finally, the case of your dataIndex attributes, in your ColumnModel, must match up with the name attributes of your field definition list, so if the 'name' of the field is defined as "WADID", then the 'dataIndex' of that column should also be "WADID".

    Side Note: Unless that cfc is on another server you should be able to use just the 'url' attribute of the store, without defining a proxy.
    --
    Steve "Cutter" Blades
    Adobe Community Professional - ColdFusion
    Adobe Certified Professional - Advanced Macromedia ColdFusion MX 7 Developer

    _____________________________
    Blog: Cutter's Crossing

    Co-Author "Learning Ext JS 3.2"

  5. #15
    Ext JS Premium Member CutterBl's Avatar
    Join Date
    Aug 2007
    Location
    Nashville, TN
    Posts
    236
    Vote Rating
    0
    CutterBl is on a distinguished road

      0  

    Default


    Oh yeah, and you shouldn't put your paging stuff in the baseParams, but rather within the load() method itself:

    Code:
    store.load({params:{start:0, limit:25}});
    You'll have to change the argument names in the cfc function, as Ext will automatically use these param names for the paging stuff.
    --
    Steve "Cutter" Blades
    Adobe Community Professional - ColdFusion
    Adobe Certified Professional - Advanced Macromedia ColdFusion MX 7 Developer

    _____________________________
    Blog: Cutter's Crossing

    Co-Author "Learning Ext JS 3.2"

  6. #16
    Ext User
    Join Date
    May 2010
    Posts
    6
    Vote Rating
    0
    PatJ is on a distinguished road

      0  

    Default


    Thanks for the input. I apologize for being so clueless about this but I have tried everything I can and I just can't seem to get this to work. At this point I have no clue what I'm doing. Maybe I've read too many online forums and I'm just totally confused. I'm working this issue on my own time and I need to move on if I can't get it working. I've tried to simplify it down even more - maybe too simple? I keep thinking the URL path is the problem - it simply can't find my CFC, although I've tried moving the JS file to the root level and changing the URL path. Here is my file structure:
    Root level> test2.cfm
    Root level > cfcs > test.cfc
    Root level > js > ext > test3.js
    I placed comments in the test3.js file shown below. At this point I simply want to see some data in the store via Firebug, so I removed the call to the grid. Is there some place in Firebug to determine if the CFC is actually called. I've looked everywhere in Firebug and can't seem to find anything that is related to what I'm looking for. How do I know the CFQueryReader is functioning properly? How do I know that it found my CFC? I hate to give up but must move on.
    Thanks,
    Pat
    << test2.cfm >>
    <html>
    <head>
    <title>test page 2</title>
    <cfinclude template="_css_jslibs.cfm">
    <script type="text/javascript" src="ext/CFQueryReader/js/custom/CFQueryReader.js"></script>
    <script type="text/javascript" src="ext/examples/ux/PanelResizer.js"></script>
    <script type="text/javascript" src="ext/examples/ux/SlidingPager.js"></script>
    <script type="text/javascript" src="ext/src/widgets/grid/ColumnModel.js"></script>
    <script type="text/javascript" src="test3.js"></script>
    </head>
    <body>
    <cfoutput>

    </cfoutput>
    </body>
    </html>
    << test.cfc >> I have both query and grid return functions, I've tried using both.
    <cfcomponent>
    <cffunction name="getwads" access="remote" output="true" returntype="any" returnformat="JSON">
    <cfargument name="page" type="numeric" required="yes">
    <cfargument name="pageSize" type="numeric" required="yes">
    <cfargument name="gridsortcolumn" type="string" required="no" default="">
    <cfargument name="gridsortdirection" type="string" required="no" default="">
    <cfquery name="getwads" datasource="#request.dsn#">
    SELECT wadid, title
    FROM db_wad
    </cfquery>

    <cfreturn QueryConvertForGrid(getwads, page, pageSize) />
    </cffunction>

    <cffunction name="getwads2" access="remote" output="true" returntype="any" returnformat="JSON">
    <cfquery name="getwads" datasource="#request.dsn#">
    SELECT wadid, title
    FROM db_wad
    </cfquery>
    <cfreturn getwads />
    </cffunction>

    </cfcomponent>
    << test3.js >>
    Ext.onReady(function(){
    var myDataModel = [
    {name: 'WADID', mapping: 'WADID'},
    {name: 'TITLE', mapping: 'TITLE'}
    ];
    var myCFReader = new Ext.data.CFQueryReader({id:'WADID'},myDataModel);
    var store = new Ext.data.Store({
    totalProperty: 'TOTALROWCOUNT',
    root: 'QUERY',
    // these comments are not in the actual test3.js file
    // the url is currently defined from the root, if defined from the js directory
    // it would be '../../cfcs/test.cfc?method=getwads'
    url:'cfcs/test.cfc?method=getwads',
    id:'WADID',
    successProperty: 'SUCCESS',
    remoteSort:true,
    baseParams: { returnformat: 'JSON'},
    reader: myCFReader
    });
    store.load({params:{page:1, pageSize:16}});
    console.info('Store count = ', store.getCount());

    });
    Lastly here is the JSON output for both functions in test.cfc; I used the following program to display this:
    <html>
    <head>
    <title>Test 1</title>
    <cfinclude template="_css_jslibsCF.cfm">
    </head>
    <body>
    <cfoutput>
    <cfinvoke component="cfcs.test" method="getwads" returnVariable="wadlist" page="1" pageSize="16" />
    #SerializeJSON(wadlist)#
    <br /><br />
    <cfinvoke component="cfcs.test" method="getwads2" returnVariable="wadlist" />
    #SerializeJSON(wadlist)#
    </cfoutput>
    </body>
    </html>
    JSON output for the above program >>
    {"TOTALROWCOUNT":16,"QUERY":{"COLUMNS":["WADID","TITLE"],"DATA":[[45000,"Adding instrumentations to monitor flowrate, temperatures and KW readings of the new 700 HP compressor "],[45001,"Remove tombstone & install new wall receptacle"],[45002,"Upgrade Refrigerant Storage Systems "],[45003,"E267 Install Burglar Bars on West Wendow outside of fence "],[45004,"Install Backup Generator for Child Care Center "],[45005,"Perform design for Third Street\/P. Lot C-3 paving "],[45006,"Install Electrical Power EOC - Room 3118 "],[45007,"Clean and Touch-Up Paint Chamber A 40 Ft Door"],[45009,"Conference Room Upgrade "],[45010,"Install Sound Soak & Chairs Rails on Walls of Video Lab and Classroomss"],[45011,"Add 20 AMP power to B1\/378 for redundant router installation "],[47072,"ReRoof Building 48 "],[47073,""],[47074,""],[47075,""],[47076,""]]}}
    {"COLUMNS":["WADID","TITLE"],"DATA":[[45000,"Adding instrumentations to monitor flowrate, temperatures and KW readings of the new 700 HP compressor "],[45001,"Remove tombstone & install new wall receptacle"],[45002,"Upgrade Refrigerant Storage Systems "],[45003,"E267 Install Burglar Bars on West Wendow outside of fence "],[45004,"Install Backup Generator for Child Care Center "],[45005,"Perform design for Third Street\/P. Lot C-3 paving "],[45006,"Install Electrical Power EOC - Room 3118 "],[45007,"Clean and Touch-Up Paint Chamber A 40 Ft Door"],[45009,"Conference Room Upgrade "],[45010,"Install Sound Soak & Chairs Rails on Walls of Video Lab and Classroomss"],[45011,"Add 20 AMP power to B1\/378 for redundant router installation "],[47072,"ReRoof Building 48 "],[47073,""],[47074,""],[47075,""],[47076,""]]}

  7. #17
    Ext User
    Join Date
    May 2010
    Posts
    6
    Vote Rating
    0
    PatJ is on a distinguished road

      0  

    Default


    I have just discovered in Firebug the "XHR" tab and have viewed the POST "test.cfc" response and I see the properly formatted JSON output. This is the JSON directly from Firebug:

    {"TOTALROWCOUNT":16,"QUERY":{"COLUMNS":["WADID","TITLE"],"DATA":[[45000,"Adding instrumentations to monitor flowrate, temperatures and KW readings of the new 700 HP compressor "],[45001,"Remove tombstone & install new wall receptacle"],[45002,"Upgrade Refrigerant Storage Systems "],[45003,"E267 Install Burglar Bars on West Wendow outside of fence "],[45004,"Install Backup Generator for Child Care Center "],[45005,"Perform design for Third Street\/P. Lot C-3 paving "],[45006,"Install Electrical Power EOC - Room 3118 "],[45007,"Clean and Touch-Up Paint Chamber A 40 Ft Door"],[45009,"Conference Room Upgrade "],[45010,"Install Sound Soak & Chairs Rails on Walls of Video Lab and Classroomss"],[45011,"Add 20 AMP power to B1\/378 for redundant router installation "],[47072,"ReRoof Building 48 "],[47073,""],[47074,""],[47075,""],[47076,""]]}}

    This is params info directly from Firebug (from the POST tab):
    page=1&pageSize=16&returnformat=JSON

    I guess this tells me that test3.js is finding and executing the CFC properly. I guess the question now is why isn't it loading into the store? I feel like I'm so close!!

  8. #18
    Ext User
    Join Date
    May 2010
    Posts
    6
    Vote Rating
    0
    PatJ is on a distinguished road

      0  

    Default


    I have it working now. It took an "autoLoad: true" inside the store to make it work. I don't know why trying to load the store outside the declaration doesn't work. Here is the store definition that works:
    var store = new Ext.data.Store({
    totalProperty: 'TOTALROWCOUNT',
    root: 'QUERY',
    url:'cfcs/test.cfc?method=getwads',
    id:'WADID',
    successProperty: 'SUCCESS',
    remoteSort:false,
    baseParams: { returnformat: 'JSON'},
    reader: myCFReader,
    autoLoad: true,
    id:'myStore',
    listeners: {
    load: function(store, records, options) {
    console.info('store load, arguments:',arguments);
    console.info('Store count = ',store.getCount());
    }
    }
    });
    Adding the listners helped me see what was happening. I found this code in digging around different forums. Maybe at some point someone can offer an explanation as to why loading the store outside the store definition didn't work. Thanks for the help!
    Pat

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi