1. #1
    Sencha Premium Member
    Join Date
    Jun 2009
    Location
    Rio de Janeiro, Brazil
    Posts
    13
    Vote Rating
    0
    stefanosandes is on a distinguished road

      0  

    Default Answered: New datatype in MVC

    Answered: New datatype in MVC


    Hi everyone,

    I need to create a new datatype for my model, I get a json server using this format: "/ Date (1333249200000) /", but the DATE type generates an warning. So I need to create my own datatype.

    My new datatype is this:

    PHP Code:
    Ext.data.Types.JDATE = {
         
    convert: function (valuerecord) {
             var 
    exp = / ([^ /]) + /;
             return new 
    Date (eval (value.match (exp) [0]));
         }
         
    type'JDate'
    }; 
    I'm using an example I saw in the documentation. My question is: Where should I put this code?

    My application follows the MVC pattern.

    Sorry for my bad English.

    Thanks!


  2. #2
    Sencha User jerome76's Avatar
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,149
    Answers
    132
    Vote Rating
    99
    jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice

      1  

  3. #3
    Sencha Premium Member
    Join Date
    Jun 2009
    Location
    Rio de Janeiro, Brazil
    Posts
    13
    Vote Rating
    0
    stefanosandes is on a distinguished road

      0  

    Default


    Quote Originally Posted by jerome76 View Post
    Very goooood!!

    Thank you!!!!

Thread Participants: 1

Tags for this Thread