Welcome Guest Search | Active Topics | Sign In | Register

Problem calling javascript function Options
Sergio
Posted: Wednesday, July 31, 2013 2:41:05 PM
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.
eo_support
Posted: Wednesday, July 31, 2013 2:43:58 PM
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!
Sergio
Posted: Friday, August 2, 2013 3:18:43 PM
Rank: Member
Groups: Member

Joined: 3/30/2011
Posts: 16
Hello,

There is a sample in the url

http://programe.com.mx/webapplication3.zip

in 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.
eo_support
Posted: Friday, August 2, 2013 4:27:55 PM
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!
Sergio
Posted: Friday, August 2, 2013 10:11:04 PM
Rank: Member
Groups: Member

Joined: 3/30/2011
Posts: 16
Hello,

Thank you very much!!!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.