Quantcast

Troubles upgrading to dgrid 1.1.0 and dStore

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Troubles upgrading to dgrid 1.1.0 and dStore

Harry Devine
I'm trying to upgrade my project to use dgrid 1.1.0 and dStore, and I
keep running into issues.  I have read the migration guide, and I
"think" I followed it, but I still can't get my grids to initialize.  
Here's what I'm trying:

         var PlayerGrid = declare([OnDemandGrid, Selection, Editor,
ColumnResizer, Pagination]);
         var TrackableMemory = declare( [RequestMemory, Trackable] );
         mod.playerStore = new TrackableMemory({target: "adminUsers.php"});

         if (!registry.byId("adminUsersGrid")) {
           mod.grid = new PlayerGrid({
             columns: columns,
             collection: mod.playerStore,
             loadingMessage: "Retrieving Applecart users...",
             noDataMessage: "No Applecart users found!",
             sort: [{attribute: "name", descending: false}],
             pagingLinks: 2,
             firstLastArrows: true,
             rowsPerPage: 20
           }, "adminUsersGrid");
         }
         else {
           mod.grid.set("collection", mod.playerStore);
         }
         mod.grid.startup();

Here's the error I'm getting in the web console:

/dojo-utils/dgrid/_StoreMixin.js:33

TypeError: Cannot read property 'indexOf' of undefined
     at makeGetter (/dojo-utils/dstore/SimpleQuery.js:10:15)
     at eval (/dojo-utils/dstore/SimpleQuery.js:195:54)
     at Array.sort (native)
     at Object.eval [as querier] (/dojo-utils/dstore/SimpleQuery.js:188:10)
     at TMP.fetchSync (/dojo-utils/dstore/Memory.js:216:25)
     at TMP.fetchRangeSync (/dojo-utils/dstore/Memory.js:226:20)
     at TMP.eval [as fetchRange] (/dojo-utils/dstore/Promised.js:14:35)
     at eval (/dojo-utils/dstore/Cache.js:69:26)
     at _2f8 (http://192.168.56.101/dojoroot/dojo/dojo.js:8:68466)
     at _2f2 (http://192.168.56.101/dojoroot/dojo/dojo.js:8:68330)

Please help! Thanks!

Harry

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Troubles upgrading to dgrid 1.1.0 and dStore

Arnd Beissner
From the information so far, it seems dStore is throwing that exception while sorting. The first thing I would check is if the property „name“, which you use to sort, actually exists on the objects in your collection. The makeGetter function that crashes uses indexOf to see if the property name contains a dot (subproperty support).
-- 
Arnd Beißner

Am 23.03.2017 um 01:13 schrieb Harry Devine <[hidden email]>:

I'm trying to upgrade my project to use dgrid 1.1.0 and dStore, and I
keep running into issues.  I have read the migration guide, and I
"think" I followed it, but I still can't get my grids to initialize.  
Here's what I'm trying:

        var PlayerGrid = declare([OnDemandGrid, Selection, Editor,
ColumnResizer, Pagination]);
        var TrackableMemory = declare( [RequestMemory, Trackable] );
        mod.playerStore = new TrackableMemory({target: "adminUsers.php"});

        if (!registry.byId("adminUsersGrid")) {
          mod.grid = new PlayerGrid({
            columns: columns,
            collection: mod.playerStore,
            loadingMessage: "Retrieving Applecart users...",
            noDataMessage: "No Applecart users found!",
            sort: [{attribute: "name", descending: false}],
            pagingLinks: 2,
            firstLastArrows: true,
            rowsPerPage: 20
          }, "adminUsersGrid");
        }
        else {
          mod.grid.set("collection", mod.playerStore);
        }
        mod.grid.startup();

Here's the error I'm getting in the web console:

/dojo-utils/dgrid/_StoreMixin.js:33

TypeError: Cannot read property 'indexOf' of undefined
    at makeGetter (/dojo-utils/dstore/SimpleQuery.js:10:15)
    at eval (/dojo-utils/dstore/SimpleQuery.js:195:54)
    at Array.sort (native)
    at Object.eval [as querier] (/dojo-utils/dstore/SimpleQuery.js:188:10)
    at TMP.fetchSync (/dojo-utils/dstore/Memory.js:216:25)
    at TMP.fetchRangeSync (/dojo-utils/dstore/Memory.js:226:20)
    at TMP.eval [as fetchRange] (/dojo-utils/dstore/Promised.js:14:35)
    at eval (/dojo-utils/dstore/Cache.js:69:26)
    at _2f8 (http://192.168.56.101/dojoroot/dojo/dojo.js:8:68466)
    at _2f2 (http://192.168.56.101/dojoroot/dojo/dojo.js:8:68330)

Please help! Thanks!

Harry

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Troubles upgrading to dgrid 1.1.0 and dStore

Harry Devine

There was a "name" property in my returned data.  What the issue was was that in my sort, I had the old "attribute" name, and the new grid needs "property" instead.  Now the data is returned, but there is a ton of extra space in each row.  Looking into that now, but if you have any suggestions for that, I'm all ears.

Thanks,

Harry

On 3/23/2017 4:55 AM, Arnd Beissner wrote:
From the information so far, it seems dStore is throwing that exception while sorting. The first thing I would check is if the property „name“, which you use to sort, actually exists on the objects in your collection. The makeGetter function that crashes uses indexOf to see if the property name contains a dot (subproperty support).
-- 
Arnd Beißner

Am 23.03.2017 um 01:13 schrieb Harry Devine <[hidden email]>:

I'm trying to upgrade my project to use dgrid 1.1.0 and dStore, and I
keep running into issues.  I have read the migration guide, and I
"think" I followed it, but I still can't get my grids to initialize.  
Here's what I'm trying:

        var PlayerGrid = declare([OnDemandGrid, Selection, Editor,
ColumnResizer, Pagination]);
        var TrackableMemory = declare( [RequestMemory, Trackable] );
        mod.playerStore = new TrackableMemory({target: "adminUsers.php"});

        if (!registry.byId("adminUsersGrid")) {
          mod.grid = new PlayerGrid({
            columns: columns,
            collection: mod.playerStore,
            loadingMessage: "Retrieving Applecart users...",
            noDataMessage: "No Applecart users found!",
            sort: [{attribute: "name", descending: false}],
            pagingLinks: 2,
            firstLastArrows: true,
            rowsPerPage: 20
          }, "adminUsersGrid");
        }
        else {
          mod.grid.set("collection", mod.playerStore);
        }
        mod.grid.startup();

Here's the error I'm getting in the web console:

/dojo-utils/dgrid/_StoreMixin.js:33

TypeError: Cannot read property 'indexOf' of undefined
    at makeGetter (/dojo-utils/dstore/SimpleQuery.js:10:15)
    at eval (/dojo-utils/dstore/SimpleQuery.js:195:54)
    at Array.sort (native)
    at Object.eval [as querier] (/dojo-utils/dstore/SimpleQuery.js:188:10)
    at TMP.fetchSync (/dojo-utils/dstore/Memory.js:216:25)
    at TMP.fetchRangeSync (/dojo-utils/dstore/Memory.js:226:20)
    at TMP.eval [as fetchRange] (/dojo-utils/dstore/Promised.js:14:35)
    at eval (/dojo-utils/dstore/Cache.js:69:26)
    at _2f8 (http://192.168.56.101/dojoroot/dojo/dojo.js:8:68466)
    at _2f2 (http://192.168.56.101/dojoroot/dojo/dojo.js:8:68330)

Please help! Thanks!

Harry

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest





--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Loading...