grid data sometimes doesn't display after replacing data
I load 15 rows of data into javascript associative array when the page loads and it displays fine in the grid. Then I load 1000 rows into the array and it displays fine in the grid. Now when I load a smaller number of rows into the array, the grid shows blank in all the rows. I can't make the problem repeat yet.
Code for loading new data into array and refreshing the grid on button click:
gridCdmItems.setCellText( function( ixCol, ixRow ){ return aarCdmItems[arrDbColumnNames[ixCol]][ixRow] } );
function eventDo( evt )
{
if( evt == 'getCdmItemsClick' || evt == 'cdmChange' )
{
getCdmItems( document.getElementById( 'cdmId' ).value, document.getElementById( 'numCdmItems' ).value );
gridCdmItems.setRowProperty("count", cdmItemsRowCount);
gridCdmItems.setColumnProperty("count", cdmItemsColumnCount);
gridCdmItems.refresh();
document.getElementById( 'cdmItemsCount' ).innerText=cdmItemsRowCount;
}
}
Jim D.
January 30,
Jim D. are you using version 1 or 2 of the toolkit?
Jim Hunter
January 30,
Sorry, I should've supplied more information.
version 2.0 beta 4
ie6
virtual mode on or off
I haven't tested on firefox. I did a lot of fiddling but couldn't find a pattern for failure, so I wonder if it's a race condition.
Jim D.
January 30,
The reason I asked was because you are using the 'old' method of setting the row count and the column count. The Version 2 way is:
obj.setRowCount(##);
obj.setColumnCount(##);
And it looks like you are not re-assigning the data array to the grid in the eventDo function when you are loading new data, this is essential. Every time you make broad sweeping changes to the data array I suggest that you reconnect the array to the grid using the same method as you do to load the data initially:
gridCdmItems.setCellText( function( ixCol, ixRow ){ return aarCdmItems[arrDbColumnNames[ixCol]][ixRow] } );
If you reconnect the array (this sets up the internal indexes of viewable rows etc), set the row count and then call refresh you should be good to go.
Jim Hunter
January 31,
Thanks. I'll keep testing to see if this does the trick.
I'm having the same problem that many other people are. Am I supposed to look at the source code to learn what the API is? I have, but I can't be sure that I'm looking at the right thing. It appears that old and new may be mixed together. Is the source all 2.0 with no 1.0 API left in it? The examples don't seem to completely describe use of the API. The documentation has a 1.0 section, so does that mean that everything outside that section is 2.0? I keep hoping to find a way to get stable behavior so we can purchase an enterprise license, but I'm not getting there. I don't know if I'm using the product correctly. Sorry - this is not a rant, it's just a fact.
muley88
January 31,
In the examples that are provided in the QuickRef directory, there is no 1.0 code. All the code is in the new 2.0 way of doing things. Although the old code might look like it works because you don't get errors, I would not rely on it working in the future. Especially concidering that the interface did change with respect to the 1.0 code in that cell references got the row/col positions reversed in 2.0. This will break all 1.0 code examples, period.
I agree that the Documentation on the web site can be a little confusing. I have learned that the "Other Controls" & "Class Reference" item (3rd and 4th from the top when all collapsed) are the documentation for 2.0 classes and controls. In there you will see all of the methods that are available for each item in each namespace. I am using this area to create a suite of test cases for testing the controls. So far everything is doing well. I have only found a couple of anomolies in the documentation. If you read through that area of the documentation as well as the examples in the QuickRef forlder, you will get a better understanding of the way you can begin to think in the new 2.0 methodology. The more I read the better I like the 2.0 way. It is MUCH cleaner to do things. Your code is 200% more readable later when you go back to it.
I also suggest reading every new post on the forum to pick up on some little trick someone else has found. I know I have learned a bunch reading the postings of others.
Jim Hunter
January 31,
Thanks for the tips.
Since I have you here, can you tell me how support works? Does Alex see the issues here by scanning the forums and picking out what he feels is important to work on? Do you know how things get prioritized? Is Alex is the only person providing support? Is it possible to email him directly, or is he too busy to respond?
Jim D.
January 31,
I can't answer for Alex but I can tell you that I scan every post and answer the ones I think I know about. I try to leave the rest for Alex or anyone else that can provide assistance. This is a community forum to allow everyone to help everyone. If you are a registered owner of the product then you will have other means of contacting him. There is an e-mail address posted for support but I can't begin to answer as to what order or priority things get answered in. I have actually recieved e-mails from more then just Alex, so he does have some help.
Jim Hunter
January 31,
I'm doing a grid.clear() and setting up the grid again as though it's being loaded for the first time, and the problems are gone. I don't know how few steps I can get away with, but doing everything again works.
Jim D.
February 1,