PDA

View Full Version : [CLOSED] Customize Grid column header menu



iansriley
Sep 09, 2014, 6:22 PM
Hi,

We have a requirement that will have to add the few more check box menu items to the existing column header menu, However those Checkbox menu items will not available in the grid

How can we add more columns in the Column header menu so i customize the view base don those checked menu items ( customized)..
Please look at the below image for you reference..

Thanks in advance ....

Daniil
Sep 10, 2014, 8:05 AM
Hi @iansriley,

I think these is no a built-in possibility to customize that menu.

Overriding JavaScript code is a way to go.

iansriley
Sep 10, 2014, 1:53 PM
Can you Please give me a sample code
so i can override this as per my requirement.
Thanks in advance

Daniil
Sep 10, 2014, 2:28 PM
Unfortunately, I don't have such an example.

I can recommend you, for the beginning, to find what you should override.

iansriley
Sep 23, 2014, 1:57 PM
ok, So i m able to get the required columns by adding dynamically,

Can you just let me the how can i find the selected columns on mouse out from Columns Menu Item MenuItem.

Thanks in advance.

Daniil
Sep 24, 2014, 9:40 AM
Hope this helps.

var columnItem = App.GridPanel1.headerCt.menu.items.get("columnItem");

columnItem.mon(columnItem.el, "mouseleave", function() {
columnItem.menu.items.each(function(item) {
if (item.checked) {
console.log(item.text);
}
});
}, columnItem);

iansriley
Sep 25, 2014, 10:30 AM
Thanks , this is working fine..

iansriley
Sep 26, 2014, 3:43 PM
Sorry, that was working with some other functionality which is not working properly now,

In order to achieve my requirement, also please let us know where to place the above function,

and also have modified the above code as



var columnItem = App.GrdiPanel.headerCt.getMenu().items.get("columnItem");


columnItem.mon(columnItem.el, "mouseleave", function () {
columnItem.menu.items.each(function (item) {
if (item.checked) {
alert(item.text);
}
});
}, columnItem);


have tried by placing the function in the below two places
#1.
called the above code under


<Listeners>
<ViewReady Handler="ClickEventFires()">
</ViewReady>
</Listeners>

and also on
#2.Ext.OnReady
Then this is having an error ,the error messages has been attached below,

Daniil
Sep 27, 2014, 7:31 AM
I think the "columnItem" component is created at the first appearance of the header menu. So, you should run that code after the first appearance.