View Full Version : Grid RowExpander with icon with +

29 Aug 2009, 12:03 AM
I want to place an icon instead of "+" and "-" for the rowexpander.

This is because I open a new window on click of "+" (then it would be "-")and when I close new window , I need to make automatically "-" to "+" again. I donno how to make that .
Or else I want to keep and icon instead of "+" onclick opens the new window.

From the above two if I get some idea, it would make my life easier.

Thank you,

29 Aug 2009, 1:18 AM
Do you actually need a RowExpander if you don't want to show detail data below the row, but in a separate window?
Wouldn't the RowActions plugin (user extension) work better in that case?

On replacing the +/- icon: The images can be replaced with a simple css rule.

29 Aug 2009, 10:31 AM
I tried RowAction plugin, somehow I din't feel comfortable and right now I don't have time to change things , This is goign to production and have couple of days to wrap up. thats the reason I am looking for a solution for expander without "+/-" signs replacing icon or something else so that onclick it does its work.

Anyways, i'll look into RowAction plugin again.

Thank you,

29 Aug 2009, 10:38 AM
I want the following way ,
When I click "+" , new window is opened and '-" is shown on main window .
When I close the the new window I want somehow that main window "-" should become "+" automatically,
like onclick of close button of new window should make "-" to "+".

Condor, Please help me if this is possible by anyway.

30 Aug 2009, 8:26 PM

Any suggestions?

30 Aug 2009, 10:03 PM
If would add a field to the record that holds the instance of the window (or null) and add a renderer that displays a + or - depending on the window presence.
Next, I would add a cellclick handler that creates/closes the window. You also need a close handler on the window that changes the record field to null again.

31 Aug 2009, 7:04 PM
I definetely need an example(or hint), it is really hard for me to get it started.

How do I make "-" to plus on window close for that row - rowCollapsedClass : 'x-my-grid3-row-collapsed'

Please help me.

Thank you,

31 Aug 2009, 8:30 PM
break what Condor said into small chunks:

Edit your store or record definition and include a field for the window opening
Create a custom renderer on the column that displays this field to show a "+" or "-" image depending on the underlying data value of the field.
Add a 'cellclick' listener to the grid to open the windows.
When the window opens, update the field with the relevant value ("minus" maybe).
Add a listener to the window close event which updates the field to the relevant value ("plus" maybe).