Problem with getRowIndices()
I load an XML table into the Grid.
It displays GREAT.
I click on a "Print" button that executes a function that opens a new window and has a formated table based on getRowIndices() - this way, it is only building a new page based on the grid-displayed-rows (based on the getRowIndices.
Here is my problem.
If a user clicks on my Print button right after the grid loads, my new page has no data and all broken images (because the images are based on the cells. It does create the necessary number of rows (it does match what is in the grid).
But, if the user applies a FILTER to the grid after it loads and THEN clicks my print button, the new window has EXACTLY the right information.
I'm assuming this means that the getRowIndices array has no value upon the initial GRID population (which, to me is rather strange). If rows are visible the getRowIndices should be populated.
Is there a way to get the row indices after the grid has loaded? This way, I have values when I need them? I never know how much data is in the grid prior to loading it - the data is read from an XML file.
I'm thinking after the document.write(obj), I could do something like:
But the problem with that is, my showAll function (which does populate the row indices based on ALL the visible rows - being all - doesn't have a value for the number of rows at that point - obj.getRowCount comes back as null.
It's really frustrating ... and I'm sure I'm confusing above.
getRowIndices() method may return null. It happens when each row index equals row position, i.e. 0, 1, 2 ... rowCount()-1. For example if you do not assign rowIndices explicitly and do not sort the grid - then getRowIndices() will return null. Which means you should always test the returned value and if it is null - you can use row position instead of index.
This was done to improve grid performance with very large number of rows. But I agree that it is also very confusing, so probably I need to change this behavior (i.e. always return an array from getRowIndices()).
Now I'm tackling another "enhancement" - and yes, another thing to learn.
When a person selects a row and clicks an "Add" button, I'm storing the data in column 0 (because of the data set, I'll never be sure of the row but I am sure of the data being unqiue) in a cookie.
This way, later instead of reading through 10000 rows, I can give them an option to view just the ones they added to their "personal list".
Well, time to figure out cookies!
Thanks again for all your help.
This topic is archived.
Back to support forum
Version 2Looking for AW 2.6 ?
The old site is here.