Discussion:
[Dojo-interest] Error in integrating dgrid and JsonRest
heekim1
2015-02-24 06:00:12 UTC
Permalink
I have been using DataGrid and JsonRest store successfully.
Now I am replacing DataGrid with dgrid while keeping the JsonRest store.

Here is the my code,


<script>
require([
"dgrid/OnDemandGrid",
"dojo/_base/declare",
"dojo/store/JsonRest",
"dojo/store/Cache",
"dojo/store/Memory",
"dojo/domReady!"
],
function(Grid, declare, JsonRest, Cache, Memory){

var tmpStore = JsonRest({target:"/test"});
var myStore = new Cache(tmpStore, new Memory());

var grid = new (declare([Grid]))({
store: myStore,
columns: {
x: 'X',
y: 'Y',
z: 'Z'
}
}, 'grid');
grid.startup();
});

It renders its header.
However, I have an unexpected error:
"_StoreMixin found store property but not collection; this is often the sign
of a mistake during migration from 0.3 to 0.4"
It didn't get and render data from server.

I tried the latest dgrid as well as dgrid-0.3.0, dgrid-0.3.16 and
dgrid-0.4.0 with dojo-release-1.9.1-src.
I don't see any difference.

please help me

Thank you

Hee




--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Error-in-integrating-dgrid-and-JsonRest-tp4005409.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

Dojo-***@mail.dojotoolkit.org
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Deno Vichas
2015-02-24 06:04:33 UTC
Permalink
var grid = new Grid({
store: myStore,
columns: {
x: 'X',
y: 'Y',
z: 'Z'
}
}), 'grid');


not sure about the column syntax. I use a different one.
Post by heekim1
I have been using DataGrid and JsonRest store successfully.
Now I am replacing DataGrid with dgrid while keeping the JsonRest store.
Here is the my code,
<script>
require([
"dgrid/OnDemandGrid",
"dojo/_base/declare",
"dojo/store/JsonRest",
"dojo/store/Cache",
"dojo/store/Memory",
"dojo/domReady!"
],
function(Grid, declare, JsonRest, Cache, Memory){
var tmpStore = JsonRest({target:"/test"});
var myStore = new Cache(tmpStore, new Memory());
var grid = new (declare([Grid]))({
store: myStore,
columns: {
x: 'X',
y: 'Y',
z: 'Z'
}
}, 'grid');
grid.startup();
});
It renders its header.
"_StoreMixin found store property but not collection; this is often the sign
of a mistake during migration from 0.3 to 0.4"
It didn't get and render data from server.
I tried the latest dgrid as well as dgrid-0.3.0, dgrid-0.3.16 and
dgrid-0.4.0 with dojo-release-1.9.1-src.
I don't see any difference.
please help me
Thank you
Hee
--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Error-in-integrating-dgrid-and-JsonRest-tp4005409.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

Dojo-***@mail.dojotoolkit.org
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
heekim1
2015-02-24 06:22:47 UTC
Permalink
hi denov

Thank you for your quick reply. However,
I tried with new Grid({ ..., it didn't work.

If you are using dgrid and JsonRest, would please tell me your versions.

Thank you

Hee



--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Error-in-integrating-dgrid-and-JsonRest-tp4005409p4005411.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

Dojo-***@mail.dojotoolkit.org
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Deno Vichas
2015-02-24 06:46:10 UTC
Permalink
dojo 1.10, dGrid 0.3.16

maybe you should try it without the jsonRestStore and use the memory
store with some mock data?
Post by heekim1
hi denov
Thank you for your quick reply. However,
I tried with new Grid({ ..., it didn't work.
If you are using dgrid and JsonRest, would please tell me your versions.
Thank you
Hee
--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Error-in-integrating-dgrid-and-JsonRest-tp4005409p4005411.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

Dojo-***@mail.dojotoolkit.org
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Kenneth G. Franqueiro
2015-02-24 13:58:05 UTC
Permalink
The console warning you got pretty much explains it all - you're using
dojo/store and assigning the grid a store property, but dgrid 0.4
expects a dstore collection via the collection property instead.

That said, what you have should work fine with dgrid 0.3...

If you're starting out with dgrid 0.4, you should read the docs and
tutorials pertaining to it rather than 0.3, at
https://github.com/SitePen/dgrid/tree/v0.4.0/doc and
http://dgrid.io/#tutorials respectively.

There is a 0.3->0.4 migration guide in the docs too:
https://github.com/SitePen/dgrid/blob/v0.4.0/doc/migrating/0.4-Migration.md

--Ken
Post by heekim1
I have been using DataGrid and JsonRest store successfully.
Now I am replacing DataGrid with dgrid while keeping the JsonRest store.
Here is the my code,
<script>
require([
"dgrid/OnDemandGrid",
"dojo/_base/declare",
"dojo/store/JsonRest",
"dojo/store/Cache",
"dojo/store/Memory",
"dojo/domReady!"
],
function(Grid, declare, JsonRest, Cache, Memory){
var tmpStore = JsonRest({target:"/test"});
var myStore = new Cache(tmpStore, new Memory());
var grid = new (declare([Grid]))({
store: myStore,
columns: {
x: 'X',
y: 'Y',
z: 'Z'
}
}, 'grid');
grid.startup();
});
It renders its header.
"_StoreMixin found store property but not collection; this is often the sign
of a mistake during migration from 0.3 to 0.4"
It didn't get and render data from server.
I tried the latest dgrid as well as dgrid-0.3.0, dgrid-0.3.16 and
dgrid-0.4.0 with dojo-release-1.9.1-src.
I don't see any difference.
please help me
Thank you
Hee
--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Error-in-integrating-dgrid-and-JsonRest-tp4005409.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

Dojo-***@mail.dojotoolkit.org
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
heekim1
2015-02-24 16:41:23 UTC
Permalink
Hi Kenneth

The problem is solved now!!!.
After reading the instruction, I realized that the latest dgrid was cached
in my browser because I started dgrid with latest version which is
dgrid-master, so that dgrid-0.3.x was not applied even though I replaced the
latest version with the old versions.

The reason I want to stick with JsonRest is that JsonRest supports some
great features such "range" in request header and "items" in response
header, so that I can control big data in more convenient way.

I appreciate that your response. I would like to thank other folks who sent
me reply.

Hee




--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Error-in-integrating-dgrid-and-JsonRest-tp4005409p4005417.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

Dojo-***@mail.dojotoolkit.org
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Kenneth G. Franqueiro
2015-02-24 17:04:06 UTC
Permalink
Glad you got it working. For what it's worth, dstore/Rest (plus
dstore/Request which it extends) generally supports the same (if not
more) features as dojo/store/JsonRest, so dgrid 0.4 + dstore/Rest should
also be an option.

--Ken
Post by heekim1
Hi Kenneth
The problem is solved now!!!.
After reading the instruction, I realized that the latest dgrid was cached
in my browser because I started dgrid with latest version which is
dgrid-master, so that dgrid-0.3.x was not applied even though I replaced the
latest version with the old versions.
The reason I want to stick with JsonRest is that JsonRest supports some
great features such "range" in request header and "items" in response
header, so that I can control big data in more convenient way.
I appreciate that your response. I would like to thank other folks who sent
me reply.
Hee
--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Error-in-integrating-dgrid-and-JsonRest-tp4005409p4005417.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

Dojo-***@mail.dojotoolkit.org
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Loading...