1. #1
    Sencha Premium Member
    Join Date
    May 2012
    Location
    Singapore
    Posts
    15
    Vote Rating
    0
    skumarsamy1969 is on a distinguished road

      0  

    Default form Date JSON problem

    form Date JSON problem


    Hi Friends,
    I did a model class and view with date show in grid and form, the codes were as below.
    Model Code:
    { name: 'createdDate', type: 'date', dateFormat:'time' //dateformat: 'd/m/Y' },

    Panel Grid Code:{xtype: 'datecolumn',dataIndex: 'createdDate',text: 'Created Date',format: 'd/m/Y'},
    Panel Form Code:{ xtype: 'datefield', anchor: '100%', maxWidth: 300, fieldLabel: 'Created Date', name: 'createdDate', labelWidth: 130, format: 'd/m/Y' },

    My values are show properly in the grid and form.On Save submit, i alert also showing correctly.
    My control code:
    var form = button.up('form'),
    record = form.getRecord(),
    formValues = form.getValues(false,false,false,true);
    if (form.getForm().isValid()) {
    if (record.phantom === true) {
    store.add(formValues); }
    else { record.set(formValues);
    if(record)
    console.log('update organization request for '+record.get('organizationId')); a
    lert(record.get('createdDate')); } }
    if(record.get('organizationId') == '0') {
    if(record) console.log('insert organization request for '+record.get('organizationId'));
    this.getStrOrganizationStore().insert(0, record); }
    this.getStrOrganizationStore().sync();

    on calling i check the JSON content, it as follows:{"organizationId":1,"organizationName":"RadLink Diagnostic Imaging (S) Pte Ltd","description":"","countryId":1,"telephoneNumber":"6836 0808","faxNumber":"6836 8484","createdDate":"300009e","activeStatus":false,"remarks":"Specialized in Radiology","id":null}

    i'm getting createdDate as '300009e' also i don't have id field its also padded last, my idProperty: 'organizationId',

    onsubmit server reports as follow 'The request sent by the client was syntactically incorrect.'

    Will any one please help.
    thanks in advance
    Kumar

  2. #2
    Sencha Premium Member
    Join Date
    May 2012
    Location
    Singapore
    Posts
    15
    Vote Rating
    0
    skumarsamy1969 is on a distinguished road

      0  

    Default Help need urgent

    Help need urgent


    Will someone help me on this problem, my json date shows

    "createdDate":"300009e"

    is there any way to format or encode, how this value is set.
    please help.

    thanks
    kumar

  3. #3
    Sencha Premium Member
    Join Date
    May 2012
    Location
    Singapore
    Posts
    15
    Vote Rating
    0
    skumarsamy1969 is on a distinguished road

      0  

    Default form field date format

    form field date format


    Hi Friends,
    I'm stuck here with the date format, kindly please help me out.

    My JSON return like the following

    {"Organizations":[{"entityType":"Organization","entityTypeId":null,"entityRemarks":null,"entityId":1,"organizationId":1,"locationId":null,"description":null,"createdBy":1,"lastUpdatedBy":6,"createdDate":1253704425983,"lastUpdatedDate":1329050199663,"entityStatusId":0,"entityStatus":"N","activeStatus":false,"organizationName":"Diagnostic Imaging (S) Pte Ltd","businessRegistrationNumber":null,"businessRegistrationDate":null,"address1":"Tampines Road","address2":"#08-08 Paragon Medical","city":null,"state":null,"postalCode":"238859","countryId":1,"telephoneNumber":"8636 0808","faxNumber":"8636 8484","mobileNumber":"","emailAddress":"enquiry@radlink.com.sg","websiteUrl":"www.radlink.com.sg","remarks":"Specialized in Radiology"}],"total":1,"success":true}

    i'm making use of the created date to show in the grid and form.

    in my model:

    {
    name: 'createdDate',
    type: 'date',
    dateFormat:'time'
    },

    in my grid:
    {
    xtype: 'datecolumn',
    dataIndex: 'createdDate',
    text: 'Created Date',
    format: 'd/m/Y'
    }

    in my form:


    {
    name: 'createdDate',
    type: 'date',
    dateFormat:'time'
    }

    Showing the date in grid and form were fine, but when submitting the form the JSON looks like the following.

    {"id":1,"organizationName":"Diagnostic Imaging (S) Pte Ltd","description":"","countryId":1,"telephoneNumber":"6836 0808","faxNumber":"6836 8484","createdDate":"310001e","activeStatus":false,"remarks":"Specialized in Radiology"}

    here the date is the problem, "createdDate": "310001e"

    in my server i'm getting the error as "The request sent by the client was syntactically incorrect"

    Kindly somebody help me, its really appreciated.
    thanks & regards
    kumar

  4. #4
    Sencha User
    Join Date
    Oct 2012
    Location
    Dublin, California
    Posts
    12
    Vote Rating
    0
    drgaryholland is on a distinguished road

      0  

    Default


    Not that it matters since this post is so old but you were submitting time not date and time is a number since midnight I believe.

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar