Turn Virtual Mode On/Off Dynamically?
I'm using a V2B4 XML Table (AJAX) & UI Grid. Based on the user's attribute, he/she may see 20 rows where as another user may see 1,000.
Is there a way to set the obj.VirtualMode to false/true based on the count of the table being loaded? Obviously a virtual grid for 20 rows is not ideal ~ nor is a non-virtual grid for 1,000 rows.
Thanks in advance!
obj.setVirtualMode(obj.getRowCount() > 20 ? true : false);
I haven't tested it, but should be ok
In my scenario, we are loading employee names in the grid. So when a user is scrolling down the list in virtual mode looking for a specific employee's name, the grid has to constantly "pause" to let the new rows display. When virtual is off, you can fly up and down the grid without any pauses.
In theory, my preference would be to never use Virtual Mode because of this "choppy" feel when going up/down the grid. But having the user wait for thousands of records to load is not practical either.
So in my opinion, I think Virtual Mode is only ideal if there are a large amounts of data being displayed.
Thanks for the help, but it wasn't working for me with AJAX-loaded XML data. I'll keep playing with it.
But feel free to use it as you like...
What I'd do in your case would be a search feature in which you type the name of employee, and the grid automatically scrolls to it...
function gridVirtual( chk )
gridCdmItems.setVirtualMode( chk );
I've had the grid freeze, displaying only every other row with the column data all bunched up in the area of the first column of the grid, or displaying the first 12 or so rows of the grid properly and the rest of the rows (400 or so) showing a row number in two columns and no data in other columns. I suppose something is not being set up properly.
Are you suggesting that V2 B3 Virtual Mode functioned better? I haven't really tested my code with B3 - so just curious.
I've only tested with 2.0b4.
I have it working now per Jim Hunter's suggestions. I do a grid.clear(), then set up the grid again as though it is being loaded for the first time (setCellText, etc), and this makes the transition between virtual mode and non-virtual mode work OK. It's possible that not all of the steps are needed to make the transition successfully.
This topic is archived.
Back to support forum
Version 2Looking for AW 2.6 ?
The old site is here.