Home Analyst Portal
Options

using actionLogModel on child items

Morten_MeislerMorten_Meisler Premier Partner Advanced IT Monkey ✭✭✭

The actionLogModel is a fine method to push or unshift new actionlogs to the current viewmodel, but how does it work for child items?

Example:

$.each(viewModel.ChildWorkItem, function (i, item) {

//Create actionlog entry for each item:

 ???? actionLogModel.unshift(new app.dataModels[actionLogName].recordResolved(viewModel.ResolutionDescription));

})

I am mostly familiar with C#, where you can easily check overloads and the argument syntax for methods. Checking the prototype for the actionLogModel.unshift method gives me this:

function(){var e,t=this.wrapAll(arguments);return e=Bt.apply(this,t),this.trigger(vt,{action:"add",index:0,items:t}),e}

Not exactly so friendly. arguments could be anything I guess? :) That's the downside of non-strongly typed languages, unless someone have a better way to check this? Or already know how to make it work for "external" items different from current work item.

Best Answer

Answers

  • Options
    Geoff_RossGeoff_Ross Cireson Consultant O.G.
    Ah, I knew it would be something simple :tongue:

    Thanks @james_kleinschnitz for explaining it so even I can almost understand.
  • Options
    Morten_MeislerMorten_Meisler Premier Partner Advanced IT Monkey ✭✭✭
    Great - didn't consider API calls of course :blush:

Sign In or Register to comment.