|
Rank: Member Groups: Member
Joined: 3/30/2011 Posts: 16
|
Hello,
I have a Grid and a text box, when text changes I call method textchanged and add the row in the grid, via server, at the end of method I call a java script function using ScriptManager.RegisterClientScriptBlock to go over each row in the grid, but eo_GetObject("Grid_items") returns null.
If I call the same java script function, for example using onclick event, eo_GetObject("Grid_items") returns correctly the grid.
So, if I call eo_GetObject("Grid_items") after a server method it returns null, but calling it directly from client side it returns correctly, so, how could call it???
Thank you.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
Can you create a small test page that demonstrates the problem and then post the test page? Once we have that we will try to run it here and see what we can find.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 3/30/2011 Posts: 16
|
Hello, There is a sample in the url http://programe.com.mx/webapplication3.zipin the grid.aspx you can find a text box and a grid, when type any text on textbox and lost the focus, the event ontextchange in server calls the javascript function update_total and eo_GetObject("Grid_items") returns null. If you click the button, it calls the java script function update_total and eo_GetObject("Grid_items") returns correctly the grid. Thank you.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi, We looked into the code. The reason that eo_GetObject does not see the Grid is because at that moment, the AJAX UpdatePanel has already destroyed the old Grid but the new Grid has not been fully loaded yet. In your case, you can simply set this on your Grid:
Code: HTML/ASPX
<eo:Grid .... ClientSideOnLoad="update_total" ...>
...
</eo:Grid>
And update_total will be automatically called everytime the Grid is loaded or reloaded. Then there will be no need for you to call RegisterClientScriptBlock to register the call. Thanks!
|
|
Rank: Member Groups: Member
Joined: 3/30/2011 Posts: 16
|
Hello,
Thank you very much!!!
|
|