koala-framework icon indicating copy to clipboard operation
koala-framework copied to clipboard

Change region destination and change tabs depending region row click

Open Sogl opened this issue 10 years ago • 8 comments

Hi!

Is it possible to move this south region into the first tab? image

I need to change east tabs depending on what region I click... if I click on center - I see one group of tabs, but when I click on south region row - east region change tabs to second group. Is it possible? how to change east region tabs after clicking on this south row?

Sogl avatar Dec 09 '15 08:12 Sogl

My code after trying to change region: https://gist.github.com/Sogl/0a31ce377fffb21fe29c

But now it looks like: image

How move top panel to top and bottom to bottom with all space fill? image

Sogl avatar Dec 10 '15 06:12 Sogl

I did it in a second gist revision with layout: 'border' and height: 400 to bottom GridPanel. Can I change fixed height to percentage? 80% top panel and 20% bottom panel, same as in css.

How to enable right region switching?

Sogl avatar Dec 11 '15 07:12 Sogl

border layout regions all have fixed pixel sizes - and center region fills up the rest. I don't think you can change that.

I would create a simplified testcase with Ext2.Panels only. That was I'm sure you can find the problem...

nsams avatar Dec 12 '15 16:12 nsams

border layout regions all have fixed pixel sizes - and center region fills up the rest. I don't think you can change that.

Clear.

I would create a simplified testcase with Ext2.Panels only. That was I'm sure you can find the problem...

I don't know Ext in this way or how to create testcases in other project or html-file only... all that I have learned related to KWF. Now I found a solution with fixed bottom 400px.

How to change right (east in Ext) panel depends on region click? What I mean: image

Maybe with accordion component: http://examples.extjs.eu/gridinacc.html

Steps:

  1. If I click on center top GridPanel row, I see center bottom (south) GridPanel and right (east) TabPanel in 1st open accordion
  2. If I click on center bottom (south) GridPanel row, right (east) TabPanel shows in 2nd open accordion. 1st accordion becomes collapsed but user can click on it to show TabPanel.

How to implement this? Is it possible?

Sogl avatar Dec 14 '15 06:12 Sogl

@nsams I did 80% of work, but now problem with GridPanel events. I want to add rowclick event, my code:

var flighttasks = new Kwf.Auto.GridPanel({
            controllerUrl   : '/flightplans/flights',
            region          : 'center',
            split           : true,
            bindings: [
                      ....
                      ....many bindings....
                      ....
            ],
            listeners: {
                click: function(e) {
                    alert('click');
                    console.log('click');
                },
                rowclick: function(flighttasks, rowIndex, e) {
                    alert('rowclick');
                    console.log('rowclick');
                },
                rowmousedown: function(flighttasks, rowIndex, e) {
                    alert('rowmousedown');
                    console.log('rowmousedown');
                },
                rowdblclick: function(e) {
                    alert('dblclick');
                    console.log('dblclick');
                }
            }
        });

All are not empty:

console.log(flighttasks.events.click);
console.log(flighttasks.events.rowclick);
console.log(flighttasks.events.rowmousedown);
console.log(flighttasks.events.rowdblclick);

Only double click is working, but ALL single clicks not. Why? Maybe it's related to: https://www.sencha.com/forum/showthread.php?70982-The-event-quot-rowClick-quot-does-not-work-on-grid-components&p=341842&viewfull=1#post341842 ?

p.s. rowdblclick also works in this way:

flighttasks.on('rowdblclick', function(flighttasks, rowIndex, e) {
    alert('dfdf');
});

Sogl avatar Mar 11 '16 06:03 Sogl

Also standard Ext2.grid.GridPanel events works fine: https://gist.github.com/Sogl/310431d636c731f7f3c7

What's wrong with Kwf.Auto.GridPanel one click events?

UPDATE:

As I found in /vendor/koala-framework/koala-framework/Kwf_js/Auto/GridPanel.js, event rowclick isn't exists in KWF GridPanel:

this.addEvents(
            'rendergrid',
            'beforerendergrid',
            'deleterow',
            'cellclick',
            'celldblclick',
            'rowdblclick'
        );

I'm using cellclick for now. But how to add others like rowclick?

Sogl avatar Mar 13 '16 04:03 Sogl

@nsams Same problem with standard events in AutoGrid. Where the rowclick event? Deleted? :D

Sogl avatar May 04 '16 05:05 Sogl

Kwf.Auto.GridPanel is not a Ext2.grid.GridPanel, it has a Ext2.grid.GridPanel as child - created once the meta data is fetched from the Server.

So you can't expect all methods, config settings or events in Kwf.Auto.GridPanel. We do however forward a few commonly used methods and events.

To access the Ext2.grid.GridPanel instance use:

autoGrid.on('rendergrid', function() {
    autoGrid.grid; //this is the Ext2.grid.GridPanel instance
}, this);

To configure the Ext2.grid.GridPanel use:

new Kwf.Auto.GridPanel({
    gridConfig: {
          //any Ext2.grid.GridPanel config
    }
});

nsams avatar May 16 '16 06:05 nsams