Showing posts with label trouble. Show all posts
Showing posts with label trouble. Show all posts

Wednesday, March 28, 2012

Accessing DropShadow properties through javascript

I am have trouble accessing the properties of a drop shadow through javascript. My dropshadow looks like this

<asp:Panel runat="server" id="registeredusersTab"></asp:Panel>
<atlasToolkit:DropShadowExtender id="dsregisteredusersTab" runat="server">
<atlasToolkit:DropShadowProperties targetcontrolid="registeredusersTab" opacity="0" rounded="false" trackposition="true">
</atlasToolkit:DropShadowProperties
And I'm trying to use the following script on click of another link...
<script>
$object('dsregisteredusersTab').set_Opacity(0);
</script
Its basically can't find dsregisteredusersTab. Any help would be greatly appreciated...

You need an ID on the properties object itself, not the extender. Check out the DropShadow sample page for an example of this:

<asp:Panel runat="server" id="registeredusersTab"></asp:Panel>
<atlasToolkit:DropShadowExtender id="dsregisteredusersTab" runat="server">
<atlasToolkit:DropShadowProperties targetcontrolid="registeredusersTab" opacity="0" rounded="false" trackposition="true"ID="dsBehavior">
</atlasToolkit:DropShadowProperties>

...

<script>
$object('dsBehavior').set_Opacity(0);
</script>


Thanks

Monday, March 26, 2012

Accessing complex data properties on the client side.

I'm trying to access the properties of an object passed back from a web service but am having trouble. I thought the syntax was...

results.getItem(i).getProperty(

'propertyname') but I'm getting an error 'results.getItem(i).getProperty' is not a function.

I'm able to bind 'results' to a listview fine on the client side and debug.dump shows the data being returned is correct.

i don't know what type 'results' is.
you can try to use code below to list methods and propertis of getItem(i)
function(obj)
{
for(var name in obj)
names+=name+"\n";
alert(names);
}

tonyqus:

i don't know what type 'results' is.
you can try to use code below to list methods and propertis of getItem(i)
function(obj)
{
for(var name in obj)
names+=name+"\n";
alert(names);
}

Sorry tonyqus, 'results' is a generic collection and the javascript function on the client returns '_serverType' and the property names of the objects (similar to debug.dump). If I return a datatable the following works fine.

for (var i = 0; i < results.get_length(); i++) { alert(results.getItem(i).getProperty("PropertyName"));}
Is there a way to do something similar with object collections? The object collection binds fine to a listview or select element using set_data(results) so there must be some way of referencing the properties in javascript.

Never mind:!

Came back to it today and looked a little closer at the response from fiddler for a datatable vs an object collection. Also looked a little closer at JSON (http://www.json.org/). The line results.getItem(i).getProperty("PropertyName") works with datatables where results[i].PropertyName works with collections.