PDA

View Full Version : retreiving disabled nodes of tree



sogo
10 Oct 2010, 6:07 AM
How do i retreive the disabled nodes of a tree

Condor
10 Oct 2010, 10:35 PM
Call cascade() on the root node and collect all disabled nodes.

sogo
11 Oct 2010, 12:35 AM
Hi,

Thanks the cascade function worked great. :)

Now i have a grid defined in the Ext.onReady() method.

Outside the onready() , i want to access this grid by :
Ext.fly(grid.getView().getRow(row)).addClass('red-row');

but it gives error saying Ext.fly(grid.getView().getRow(row)). is null.

Where am i going wrong?
is it that the grid is not accessible outside onready method?
When i say Ext.getCmp('grid'), i get the grid component, i checked in firebug.
but somehow this ext.fly isnt working.
Aslo basically i just want to change color of row to red, is there any other way out?

thanks in advance in anticipation of help.

Condor
11 Oct 2010, 12:47 AM
1. Is row >=0 and <= store.getCount()?
2. Are the grid rows rendered (after the viewready event)?

sogo
11 Oct 2010, 12:52 AM
Yes the grid is already rendered with all values in it. This is a functionality that i am adding after grid is rendered just to make two rows highlighted with red colour.
The same code worked when all of my code was inside the onReady method.

Condor
11 Oct 2010, 12:55 AM
Ext.fly can't be the problem. I assume it's getRow that is returning false instead of a DOM node.

Are you ABSOLUTELY sure the row exists at the time you are executing this line?

sogo
11 Oct 2010, 1:00 AM
Yes the row does exist.
The grid is already rendered with all values.
Outside onready function, i call a function hightlightRows().
In this function, i retreive all rows which are supposed to be highliged, i even get the row.
now the code to hightlight teh row in red is
Ext.fly(grid.getView().getRow(row)).addClass('red-row');
On execution of this line, it throws the error :
Ext.fly(grid.getView().getRow(row)) is undefined.

Is there any other way i can highlight the row. Beacuse i am getting the row, i can see that in firebug all values of row.

Condor
11 Oct 2010, 1:03 AM
By 'outside Ext.onReady' you mean?

When exactly is your code executed?

sogo
11 Oct 2010, 1:06 AM
Grid is rendered on screen. Then on click of import button, i open a child window to select a file. On click of OK button on this child window, this code gets executed of highlighting the row.

Condor
11 Oct 2010, 1:12 AM
So debug.

I'm pretty sure your 'row' is incorrect and that grid.getView().getRow(row) is returning false.

sogo
11 Oct 2010, 1:26 AM
Hi,

Hey since you iterated, i checked my function again and checked all values in firebug, and yes, you are right. the row that i was getting had an error and hence the problem. Now it is resolved.
Actually yesterday everything worked well, but i made some changes in code today morning which caused this problem.
I am really sorry for taking your time and again thanks for your help. really grateful to you.
yesterday was sunday and since you were not there , i wasnt getting the quick help from anyone else, the way i get from you.
Thanks a lot to you.