Hi,
I'm trying to get use attributes to pass some urls and icons around, so that I can incorporate a status icon next to the resource heading.
I've managed to come up with jQuery suitable for inserting the appropriate image element into the DOM, but when I look in my attributes, there aren't any. They were there on the server side however as it returned from GetResouces, so they don't appear to have been mapped to the client collection.
The code that I'm running on the client in response to a OnClientDataBound event is as follows:
Clearly this is susceptible to changes in css class names and markup etc. so it's not perfect.
What do I have to do to get the resource's attributes to load into the client? Is this fixed in a later version? How do I download the latest version?
Cheers.
I'm trying to get use attributes to pass some urls and icons around, so that I can incorporate a status icon next to the resource heading.
I've managed to come up with jQuery suitable for inserting the appropriate image element into the DOM, but when I look in my attributes, there aren't any. They were there on the server side however as it returned from GetResouces, so they don't appear to have been mapped to the client collection.
The code that I'm running on the client in response to a OnClientDataBound event is as follows:
function refreshStatusIcons(sender, eventArgs) { |
var allresources = sender.get_resources(); |
var jobresources = allresources.getResourcesByType('Job'); |
var resourceheaders = $('table.rsVerticalHeaderTable div.rsMainHeader', sender._element); |
resourceheaders.each(function() { |
var headerelement = $(this); |
var icon = $('.ocStatusIcon', headerelement); |
if (icon.size()==0) { |
headerelement.html('<img class="ocStatusIcon" />' + headerelement.html()); |
icon = $('.ocStatusIcon', headerelement); |
} |
var jobresource = jobresources.getResourceByTypeAndKey('Job', 'Res'+headerelement.text().trim()); |
icon.attr('src', jobresource.getAttribute('IconURL')); |
}); |
} |
Clearly this is susceptible to changes in css class names and markup etc. so it's not perfect.
What do I have to do to get the resource's attributes to load into the client? Is this fixed in a later version? How do I download the latest version?
Cheers.