Dropdown xls button

26 views
Skip to first unread message

Artyom M

unread,
Nov 17, 2014, 8:33:03 AM11/17/14
to koala-fra...@googlegroups.com
Niko,

I want to create dropdown xls menu, where user can choose in what format he wants to make unloading (as same as in main koala-app menu).
eg
Export to Xls (v)
- xls format 1
- xls format 2

How can this be done?

Niko Sams

unread,
Nov 19, 2014, 11:54:05 AM11/19/14
to Koala Framework Dev
I guess you mean in the toolbar of a grid?

when you create the GridPanel you can specify a grid config:
        var grid = new Kwf.Auto.GridPanel({
            controllerUrl: ...,
            gridConfig: {
                tbar: [{
                     text: 'foo'
                }]
            }
        });

see the ext docs for tbar:

once you have that you can put any menu items into that toolbar including dropdown like shown here:


Niko



--
You received this message because you are subscribed to the Google Groups "Koala Framework Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to koala-framework...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Artyom M

unread,
Nov 22, 2014, 9:09:41 AM11/22/14
to koala-fra...@googlegroups.com
>I guess you mean in the toolbar of a grid?
Yes.

I create what I want by this code:

var employeeWorks = new Kwf.Auto.GridPanel({
               controllerUrl   : '/exceluploads',
               region          : 'center',
               height          : 600,
               resizable       : true,
               split           : true,
               title           : 'Данные по сотрудникам',
  tbar: [  
'->',
{
text:'Выгрузки',
icon: '/assets/silkicons/page_excel.png',
cls: 'x-btn-text-icon',
menu: [{
text:'Выгрузка EXXON',
icon: '/assets/silkicons/page_excel.png',
cls: 'x-btn-text-icon',
},{
text:'Выгрузка SEIC',
icon: '/assets/silkicons/page_excel.png',
cls: 'x-btn-text-icon'
}
]
},      
  ]
        });

See tbar.jpg screen with 1 and 2 areas... 
But it creates +1 panel higher of standard panel =(
I want to change Export to excel button (area 1) to my dropdown buttons (area 2). How to do this?

And click on element of dropdown menu I want to create modal gialog with 2 datepickers - start date, end date and buttons OK, Cancel. And after click OK Excel unloading starts from start date to end date of data. How to do this too? =)
tbar.JPG

Niko Sams

unread,
Nov 24, 2014, 3:15:25 PM11/24/14
to Koala Framework Dev
that's because AutoGrid creates another panel (the actual grid) inside itself after loading meta data.

you can pass config to that inner panel by using gridConfig:
        var grid = new Kwf.Auto.GridPanel({
            controllerUrl: ...,
            gridConfig: {
                tbar: [{
                     text: 'foo'
                }]
            }
        });

--

Artyom M

unread,
Nov 26, 2014, 7:22:20 AM11/26/14
to koala-fra...@googlegroups.com
Now button on required panel. See tbar2.jpg.
But now new problem - filter between xls buttons. It should be in left position as usual.

And how to create modal form on clicking dropdown buttons? Form must have 2 calendar picker and OK button. After clicking OK - xls download. 
How to implement it?
tbar2.JPG

Artyom M

unread,
Jan 28, 2015, 9:13:37 AM1/28/15
to koala-fra...@googlegroups.com
Niko, 

Can you help me with this? At least how to call from this menu 'json-xls' method....or how to create modal window.

What I want:
1. Every meny item shows modal dialog with two fields (start date and end date) and buttons OK, Cancel.
2. After select dates and click OK - 'json-xls' called and data put into xls-template file (per item)
I need to put this logic to view or somewhere else?

p.s. Is KWF not supported now? Some bugs need KWF-core fixes.
Reply all
Reply to author
Forward
0 new messages