Hello Jim,

Jim Hunter wrote:
> 
> Yes, I think linking the controllers would be the way I would want to
> implement it because that is basically what our Win client does and I
> would
> need to replicate it as much as possible to reduce the amount of logic I
> would need to provide. It looks like I need to do some homework and learn
> this new stuff so I can start to prepare my app to use it. And viewing
> your
> virtual table withs it's speed tells me that I need to convert all my
> tables
> to virtual tables to help speed things along as well.
> 

Looking at the code I realized that there is a selection binding mechanism
already through the qx.data.controller.MSelection Mixin which is included in
both controllers. However, the problem is that I do not have a property
(yet) to which I could bind the "selection" property exposed by the
controllers.

Instead, a simple way of doing it is:

treeWidget.addListener("changeSelection", function(event)
{
            var selection = event.getData();
            if ( selection.length )
            {
              var tableController = tableWidget.getController();
              
              /*
               * set the second parameter passed to the getRowData function 
               * to the node label
               */
              tableController.getStore().getMarshaler().getQueryParams()[1]=
{ label : selection[0].label, id : selection[0].id };
              tableController.getTarget().getTableModel().reloadData();
            }
} );

And ther service method on the server will then get an object with node data
and provide response data based on this information. I have already added
this to the demo:

http://m53s12.vlinux.de/cboulanger/databinding/build/

You can trigger a reload of table data according to the selected tree node
by checking 'Bind tree selection to table'.

But maybe Martin has a better idea....

Cheers,

Christian 


-- 
View this message in context: 
http://www.nabble.com/Databinding-for-qx.ui.table.Table-and-qx.ui.treevirtual.TreeVirtual---first-alpha-version-tp23622558p23632068.html
Sent from the qooxdoo-devel mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to