Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Howto format store float numbers with itempl?

  1. #11
    Sencha Premium Member
    Join Date
    Mar 2012
    Location
    Sydney, Australua
    Posts
    73
    Vote Rating
    9
      0  

    Default

    How do you make this happen in Sencha Architect?

  2. #12
    Sencha Premium Member
    Join Date
    Mar 2012
    Location
    Sydney, Australua
    Posts
    73
    Vote Rating
    9
      0  

    Default Sencha Architect Float formatting

    None of these things work with Sencha Architect. It blocks access tot he code so you just cant these solutions into your application.

    In the end we did this:

    In the launch function we added the following formatting extensions:

    //Add in formatting functions. Used in list screens { fieldName:formatFunction }
    Ext.util.Format.null2str = function(v){
    return v !== null ? v : "";
    };


    Ext.util.Format.formatDistance = function(v){
    if (Ext.util.Format.null2str(v) === "")
    return "";
    else
    return v.toFixed(2) + " km";
    };

    And then in our itemTpl field we did the following:
    <div><font size=2><b><table width=100%><tr><td width=40%>{practitionerFullName}</td><td width=20%>{serviceType}</td><td width=20%>{startTime:date("l, F d, g:i A")}</td><td width=20%>{distance:formatDistance}</td></tr></table></div>

Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •