Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Mashup for Task Board doesn't get called when user changes
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Vladimir Petriko  
View profile  
 More options May 22 2012, 4:40 am
From: Vladimir Petriko <vlad.min...@gmail.com>
Date: Tue, 22 May 2012 11:40:47 +0300
Local: Tues, May 22 2012 4:40 am
Subject: Re: [DEV TargetProcess] Mashup for Task Board doesn't get called when user changes

Hi,

Task board is using UpdatePanel component thus you can use
ASP.NETclient-side API. In particular try to subscribe to
PageRequestManager's
"pageLoaded" event.

See the updated code below:

tau.mashups
 .addDependency('libs/jquery/jquery')
 .addMashup(function ($, config) {
   var fn = function() {
     $('td.userStories.tau-target-box').each(function (i, el) {
       var userStoryId =
$(this).find('a.tau-entity-id.tau-target-link').text();
       var url = "/targetprocess/api/v1/UserStories/" +
userStoryId.toString() + "/?&format=json&append=[Bugs-Count,Tasks-Count]";

       $.getJSON(url, function (data) {
         $.each(data.CustomFields, function (i, v) {
           if (v.Name == "Expected Completion Date" && v.Value != null) {
             var date = new Date(parseInt(v.Value.substr(6)));
             $(el).find('div:last')
                  .after("<div style='font-size: 14px; color: red;
line-height: 18px;'>Expected Completion Date:" + date.format("m/d/y") +
"</div>");
             return false; // break loop
           }
         });

         if (data['Tasks-Count'] == 0) {
           $(el).css("background-color", "pink");
         }
       });
     });
   };

   $(document).ready(fn);
   Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(fn);

});

Let us know if you have any other questions.

Best regards,
Vladimir
-------------------
TP Dev Team

2012/5/21 Aliaksei Parasiatsyeu <otryv...@gmail.com>

> I have written a mashup for the Task board, but when I change users
> the mashup does not run.  It looks like the board is updated via ajax
> because the page does not post back.  How do write my mashup in a way
> that it get's called each time the board is updated?  Is it even
> possible?

> Thanks!

> the code:
> tau.mashups
>  .addDependency('libs/jquery/jquery')
>  .addMashup(function ($, config) {
>     $('td.userStories.tau-target-box').each(function (i, el) {
>         var userStoryId = $(this).find('a.tau-entity-id.tau-target-
> link').text();
>         var url = "/api/v1/UserStories/" + userStoryId.toString() +
> "/?&format=json&append=[Bugs-Count,Tasks-Count]";

>         $.getJSON(url, function (data) {
>             $.each(data.CustomFields, function (i, v) {

>                 if (v.Name == "Expected Completion Date" && v.Value !
> = null) {
>                     var date = new Date(parseInt(v.Value.substr(6)));

>                     $(el).find('div:last').after("<div style='font-
> size: 14px; color: red; line-height: 18px;'>Expected Completion Date:
> " + date.format("m/d/y") + "</div>");

>                     return false; // break loop
>                 }

>             });

>             if (data['Tasks-Count'] == 0) {
>                 $(el).css("background-color", "pink");
>             }

>         });

>     });

>  });


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.