PDA

View Full Version : Data Binding in SA



tomdchi
22 Feb 2017, 11:46 AM
I have seen a few examples of data binding between a grid and form but they all have both components in the same class.

Are there any examples showing how to do this when a grid and form are in separate classes?

Essentially, I am trying to do what is in this fiddle (https://fiddle.sencha.com/#fiddle/1e97&view/editor) but in SA where grid and form are separate views.

https://fiddle.sencha.com/#fiddle/1e97&view/editor

a.sales
27 Feb 2017, 1:50 AM
Try to do it by code, with 'selectionchange' event of the grid.

tomdchi
3 Mar 2017, 11:04 AM
Try to do it by code, with 'selectionchange' event of the grid.

Its not the event I have a problem with but how to put everything together inside SA. All of the fiddles I have looked at are not put together in a way that can be created in SA. Here is a fiddle that works really well: https://fiddle.sencha.com/#view/editor&fiddle/1pv0

I tried to create this in SA but SA does not have any bind config options for grids, forms or really anything as far as I can tell so where is that supposed to go?
The grid in the fiddle has


bind: {
currentPerson: "{currentPerson}",
store: "{persons}",
title: "<b>{currentPerson.name}</b>"
},


How is that supposed to be put into SA?

petr.vecera
4 Mar 2017, 2:35 AM
I tried to create this in SA but SA does not have any bind config options for grids, forms or really anything as far as I can tell so where is that supposed to go?
The grid in the fiddle has


bind: {
currentPerson: "{currentPerson}",
store: "{persons}",
title: "<b>{currentPerson.name}</b>"
},


How is that supposed to be put into SA?

I am sorry this is not full answer to your question but do you know how to do data binding in SA?

Find the config you want to bind and click on the magnet icon.

55996

This will result in the data binding inside our code.

tomdchi
6 Mar 2017, 3:25 PM
I think I have things figured out pretty well so far. In case anyone else finds this thread and is having trouble with data binding in SA I have created a demo project that may help. Link to repository: https://github.com/rps-repo/extjs6-data-binding-demo.

petr.vecera
7 Mar 2017, 3:31 AM
Excellent. Thanks for sharing your demo with the community!