Results 1 to 7 of 7

Thread: Bind JSON file value to Textbox

  1. #1

    Default Bind JSON file value to Textbox

    How to bind the JSON file values to textbox?

    Below is my JSON file content.

    { "rows":[
    {
    "id":"1",
    "title":"Office Space",
    "director":"Mike Judge",
    "released":"1999-02-19"

    }
    ]
    }

    I want to bind "ID" value to one Textbox.

    Please help me.

  2. #2

  3. #3

    Default

    Yes its helpful, but here the values are hardcoded like

    xtype: 'textfield',
    labelStyle: 'font: Times New Roman; width:125px',
    fieldLabel: '*Account#',
    name: 'Account #',
    value: 'hi',
    width:200


    But for me the value can read from JSON file

    Please help

  4. #4

    Default JSONStore

    var store = new Ext.data.JsonStore({
    url: 'Jsson.json',
    root:'rows',
    fields:
    [
    'id',
    'title',
    'director',
    'released'
    ]
    });

    when i am using the below code

    adhoc_form.getForm().findField('dollaramount').setValue(store.getAt(0).data.id);

    I am getting the below error please help.

    Microsoft JScript runtime error: 'getAt(...).data' is null or not an object

  5. #5
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Have you debugged?

  6. #6

    Default

    Please find the JPG file attached.
    Attached Images Attached Images

  7. #7
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    So, when you poke into the Store and the Records, what do you find?

    You can see wat your problem is and fix it by working on it.

Posting Permissions

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