Pass Static Value to Formatter Parameters in XML View

前端 未结 6 1802
清酒与你
清酒与你 2020-12-18 09:49

I want to call the function getCountdown with two parameters:

  • The first (AuctionEnd) is dynamic from a model.
  • The second should be hard
6条回答
  •  心在旅途
    2020-12-18 10:27

    As far as I know, you cannot add static parts to the formatter, it can only take model values. For a combination of dynamic and static parts in a property see Expression Binding and Complex Binding Syntax.

    For your case, you could add two more specialized formatter functions and call the one you need:

    
    

    (You can just provide an array of path-strings in the part array.)

    formatter.getCountdownTime = function (auctionEnd) {
        return formatter.getCountdown(auctionEnd, "Time");
    }
    
    formatter.getCountdownStatus = function (auctionEnd) {
        return formatter.getCountdown(auctionEnd, "Status");
    }
    

提交回复
热议问题