Results 1 to 3 of 3

Thread: New datatype in MVC

  1. #1
    Sencha Premium Member
    Join Date
    Jun 2009
    Location
    Rio de Janeiro, Brazil
    Posts
    13
    Vote Rating
    0
      0  

    Default 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
    101
      1  

  3. #3
    Sencha Premium Member
    Join Date
    Jun 2009
    Location
    Rio de Janeiro, Brazil
    Posts
    13
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by jerome76 View Post
    Very goooood!!

    Thank you!!!!

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
  •