dgrid Grid object use with a dStore?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

dgrid Grid object use with a dStore?

Michael Schall
Normally for our grids we use the OnDemandGrid with a dstore Memory set as the collection after loading it from a web service call:


ui.button1.on("click", function() {
ui.existingItemsGrid.set("collection", new Memory({
data:  [{
"id": 1,
"firstName": "albert",
"lastName": "Blake"
}, {
"id": 3,
"firstName": "Amethyst",
"lastName": "Moreno"
}]
}));
});

I'm trying to ensure a Grid renders all its data and doesn't destroy while scrolling.  I tried to use the Grid instead of the OnDemandGrid.  However then it doesn't get the _StoreMixin so my code above doesn't fill the grid.  The only way to fill the grid I found was is using the renderArray function.  

I tried quickly to mixin the _StoreMixin, but it didn't work.  It would be nice to have a single way for my team to bind data to a grid.  Is this a dead end or something that I can get to work.

--
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
|

Re: dgrid Grid object use with a dStore?

Michael Schall
Sorry, hit send before finishing my example...

Our grid is defined with the following code:

    var CustomGrid = declare([OnDemandGrid, Keyboard, Selection, ColumnResizer, DijitRegistry]);
    ui.existingItemsGrid = new CustomGrid({
      columns: {
        firstName: "First Name",
        lastName: "Last Name"
      },
      selectionMode: "single",
      cellNavigation: false
    }, "existingItemsGrid");

If I switch out the OnDemandGrid with Grid, the data doesn't bind unless I call renderArray.


On Mon, Mar 28, 2016 at 5:18 PM, Michael Schall <[hidden email]> wrote:
Normally for our grids we use the OnDemandGrid with a dstore Memory set as the collection after loading it from a web service call:


ui.button1.on("click", function() {
ui.existingItemsGrid.set("collection", new Memory({
data:  [{
"id": 1,
"firstName": "albert",
"lastName": "Blake"
}, {
"id": 3,
"firstName": "Amethyst",
"lastName": "Moreno"
}]
}));
});

I'm trying to ensure a Grid renders all its data and doesn't destroy while scrolling.  I tried to use the Grid instead of the OnDemandGrid.  However then it doesn't get the _StoreMixin so my code above doesn't fill the grid.  The only way to fill the grid I found was is using the renderArray function.  

I tried quickly to mixin the _StoreMixin, but it didn't work.  It would be nice to have a single way for my team to bind data to a grid.  Is this a dead end or something that I can get to work.


--
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
|

Re: dgrid Grid object use with a dStore?

Kenneth G. Franqueiro
Have you seen http://dgrid.io/tutorials/1.0/single_query/ ?  I think
that's what you want.

--Ken

On 3/28/2016 6:24 PM, Michael Schall wrote:

> Sorry, hit send before finishing my example...
>
> Our grid is defined with the following code:
>
>     var CustomGrid = declare([OnDemandGrid, Keyboard, Selection,
> ColumnResizer, DijitRegistry]);
>     ui.existingItemsGrid = new CustomGrid({
>       columns: {
>         firstName: "First Name",
>         lastName: "Last Name"
>       },
>       selectionMode: "single",
>       cellNavigation: false
>     }, "existingItemsGrid");
>
> If I switch out the OnDemandGrid with Grid, the data doesn't bind unless
> I call renderArray.
>
>
> On Mon, Mar 28, 2016 at 5:18 PM, Michael Schall <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Normally for our grids we use the OnDemandGrid with a dstore Memory
>     set as the collection after loading it from a web service call:
>
>
>     ui.button1.on("click", function() {
>     ui.existingItemsGrid.set("collection", new Memory({
>     data:  [{
>     "id": 1,
>     "firstName": "albert",
>     "lastName": "Blake"
>     }, {
>     "id": 3,
>     "firstName": "Amethyst",
>     "lastName": "Moreno"
>     }]
>     }));
>     });
>
>     I'm trying to ensure a Grid renders all its data and doesn't destroy
>     while scrolling.  I tried to use the Grid instead of the
>     OnDemandGrid.  However then it doesn't get the _StoreMixin so my
>     code above doesn't fill the grid.  The only way to fill the grid I
>     found was is using the renderArray function.  
>
>     I tried quickly to mixin the _StoreMixin, but it didn't work.  It
>     would be nice to have a single way for my team to bind data to a
>     grid.  Is this a dead end or something that I can get to work.
>
>
>
>
--
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
|

Re: dgrid Grid object use with a dStore?

Michael Schall
Interesting! That should do the trick.  I didn't even think to look for an extension for the OnDemandGrid.  Thanks for the quick turnaround!

Mike

On Mon, Mar 28, 2016 at 5:27 PM, Kenneth G. Franqueiro <[hidden email]> wrote:
Have you seen http://dgrid.io/tutorials/1.0/single_query/ ?  I think
that's what you want.

--Ken

On 3/28/2016 6:24 PM, Michael Schall wrote:
> Sorry, hit send before finishing my example...
>
> Our grid is defined with the following code:
>
>     var CustomGrid = declare([OnDemandGrid, Keyboard, Selection,
> ColumnResizer, DijitRegistry]);
>     ui.existingItemsGrid = new CustomGrid({
>       columns: {
>         firstName: "First Name",
>         lastName: "Last Name"
>       },
>       selectionMode: "single",
>       cellNavigation: false
>     }, "existingItemsGrid");
>
> If I switch out the OnDemandGrid with Grid, the data doesn't bind unless
> I call renderArray.
>
>
> On Mon, Mar 28, 2016 at 5:18 PM, Michael Schall <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Normally for our grids we use the OnDemandGrid with a dstore Memory
>     set as the collection after loading it from a web service call:
>
>
>     ui.button1.on("click", function() {
>     ui.existingItemsGrid.set("collection", new Memory({
>     data:  [{
>     "id": 1,
>     "firstName": "albert",
>     "lastName": "Blake"
>     }, {
>     "id": 3,
>     "firstName": "Amethyst",
>     "lastName": "Moreno"
>     }]
>     }));
>     });
>
>     I'm trying to ensure a Grid renders all its data and doesn't destroy
>     while scrolling.  I tried to use the Grid instead of the
>     OnDemandGrid.  However then it doesn't get the _StoreMixin so my
>     code above doesn't fill the grid.  The only way to fill the grid I
>     found was is using the renderArray function.
>
>     I tried quickly to mixin the _StoreMixin, but it didn't work.  It
>     would be nice to have a single way for my team to bind data to a
>     grid.  Is this a dead end or something that I can get to work.
>
>
>
>
--
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
|

Re: dgrid Grid object use with a dStore?

Michael Schall
Sorry...  Just looking over the code and wanted to correct my previous statement for others...  The SingleQuery example page does show it is an extension for Grid, not OnDemandGrid.  Thanks again Ken!

Mike

On Mon, Mar 28, 2016 at 8:10 PM, Michael Schall <[hidden email]> wrote:
Interesting! That should do the trick.  I didn't even think to look for an extension for the OnDemandGrid.  Thanks for the quick turnaround!

Mike

On Mon, Mar 28, 2016 at 5:27 PM, Kenneth G. Franqueiro <[hidden email]> wrote:
Have you seen http://dgrid.io/tutorials/1.0/single_query/ ?  I think
that's what you want.

--Ken

On 3/28/2016 6:24 PM, Michael Schall wrote:
> Sorry, hit send before finishing my example...
>
> Our grid is defined with the following code:
>
>     var CustomGrid = declare([OnDemandGrid, Keyboard, Selection,
> ColumnResizer, DijitRegistry]);
>     ui.existingItemsGrid = new CustomGrid({
>       columns: {
>         firstName: "First Name",
>         lastName: "Last Name"
>       },
>       selectionMode: "single",
>       cellNavigation: false
>     }, "existingItemsGrid");
>
> If I switch out the OnDemandGrid with Grid, the data doesn't bind unless
> I call renderArray.
>
>
> On Mon, Mar 28, 2016 at 5:18 PM, Michael Schall <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Normally for our grids we use the OnDemandGrid with a dstore Memory
>     set as the collection after loading it from a web service call:
>
>
>     ui.button1.on("click", function() {
>     ui.existingItemsGrid.set("collection", new Memory({
>     data:  [{
>     "id": 1,
>     "firstName": "albert",
>     "lastName": "Blake"
>     }, {
>     "id": 3,
>     "firstName": "Amethyst",
>     "lastName": "Moreno"
>     }]
>     }));
>     });
>
>     I'm trying to ensure a Grid renders all its data and doesn't destroy
>     while scrolling.  I tried to use the Grid instead of the
>     OnDemandGrid.  However then it doesn't get the _StoreMixin so my
>     code above doesn't fill the grid.  The only way to fill the grid I
>     found was is using the renderArray function.
>
>     I tried quickly to mixin the _StoreMixin, but it didn't work.  It
>     would be nice to have a single way for my team to bind data to a
>     grid.  Is this a dead end or something that I can get to work.
>
>
>
>
--
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