Select to view content in your preferred language

on demand grid not working with 4.0 api

1015
3
Jump to solution
01-31-2018 11:22 AM
PeteVitt
Frequent Contributor

Hi I'm populating an ondemand dgrid with data and it works if I'm using 3.x api library,  but not the 4.x library.  Is anyone aware of issues with dgrid in the 4.x library? my code, identical for both apis is below:

BusinessGetConfirm: function (data, msg) {
//set grid with business data fromdatabase
if (msg === "ok") {
var testdata = [
{ ID: 1, Contact: "bob", Company: "tester", Address: "123", City: "Yucaipa", Zip: "92372", NAICS6: "123", NAICS6DESC: "DESC", NAICS8: "123", NAICS8DESC: "DESC" },
{ ID: 1, Contact: "bob", Company: "test", Address: "123", City: "Yucaipa", Zip: "92372", NAICS6: "123", NAICS6DESC: "DESC", NAICS8: "123", NAICS8DESC: "DESC" }
]
//businessStore = new Memory({ data: data.BusinessGetResult, idProperty: "ID" });
var businessStore = new Memory({ data: testdata });
grid = new (declare([OnDemandGrid, DijitRegistry]))({
store: businessStore,
columns: {
ID: "ID",
Contact: "Contact",
Company: "Company",
Address: "Address",
City: "City",
Zip: "Zip",
NAICS6: "NAICS6",
NAICS6DESC: "NAICS6Desc",
NAICS8: "NAICS8",
NAICS8DESC: "NAICS8Desc"
}

}, "BusinessGridDiv");
grid.startup();


}
else {
alert(msg)
}
},

Version 3.0 result

api 3.0 results

Version 4.0 result

version 4.0 result -- empty grid

Thanks

Pete

0 Kudos
1 Solution

Accepted Solutions
JohnGrayson
Esri Regular Contributor

Make sure to check out the versions used in 4.x, for example: Additional packages.  It could be something simple like setting the 'collection' property instead of 'store', or it could be something more complicated depending on what dgrid/dstore functionality you'd like to use.  Check out the migration guide here: dgrid/0.4 Migration 

View solution in original post

3 Replies
JohnGrayson
Esri Regular Contributor

Make sure to check out the versions used in 4.x, for example: Additional packages.  It could be something simple like setting the 'collection' property instead of 'store', or it could be something more complicated depending on what dgrid/dstore functionality you'd like to use.  Check out the migration guide here: dgrid/0.4 Migration 

PeteVitt
Frequent Contributor

Thanks John, this is very helpful -- I'll check it out

Pete

0 Kudos
PeteVitt
Frequent Contributor

just a few minor changes

0 Kudos