Hi all,
is there a way to allow the selection of text inside a cell if the AllowUpdate is set to false?
Hi Steve,
This was exactly the problem - thanks for your swift reply!
--S
Hello,
If you are not getting the correct object, the problem is most likely because the id's are not correct due to re-Parenting. When the grid is inside of another container(WebPanel, ContentPane, WebTab etc.) the ID will have the parent id prepended on it. So, the grid within a WebPanel will look like this. "WebPanel1_UltraWebGrid1"
So, for the id's for this particular topic, you can check the following:
With the grid Client Side Object:
grid.Element = G_"WebPanel1xUltraWebGrid1"
grid.MainGrid = "WebPanel1xUltraWebGrid1_main"
With our controls, we provide an easy way to obtain the correct ID for the grid and all of our controls. if you use the InitializeLayoutHandler, you can obtain the correct ID and use it globally anywhere else on the page. In the snippet below, I create the GridID global variable and then set it to the gridName parameter passed in by the InitializeLayoutHandler.
var GridID;
function UltraWebGrid1_InitializeLayoutHandler(gridName) {
GridID = gridName;
}
Now that we have a global GridID, we can get the grid clientside object and obtain grid.Element and grid.MainGrid for further use.
var grid = igtbl_getGridById(GridID);
I hope this helps.
Hi,
I am trying to implement this same thing but the javascript code cannot seem to find the Webgrid and I am given a javascript error on page load:
document.getelementbyID[...] is null or not an object
I cant seem to do anything to get the correct reference to the webgrid. I have had this same problem before in trying to find a pop window on the client side as well. Is there something I may be doing wrong?
--Stephen
Thank you, Steve.
Sorry, I missed a some javascript in the previous post.
I added the onmousedown for the element G_UltraWebGrid1 which is the table element for the grid which contains the rows and columns.
The full javascript should be:
window.onload = function() { document.getElementById('UltraWebGrid1_main').onmouseup = null; document.getElementById('G_UltraWebGrid1').onselectstart = null; document.getElementById('G_UltraWebGrid1').onmouseover = null; document.getElementById('G_UltraWebGrid1').onmousedown = null; }