Results 1 to 2 of 2

Thread: Issue with HttpProxy for Grid

  1. #1
    Ext JS Premium Member
    Join Date
    Dec 2010
    Posts
    37

    Default Issue with HttpProxy for Grid

    Hi,

    I am a beginner for Ext-Js, I have a problem when I am trying to save all the records in grid,

    Proxy Code
    Code:
    var proxy = new Ext.data.HttpProxy({
            api: {
                read : 'http://localhost:8080/test/lookup/lookupTerritory/data.json',
                create : {
                    url:'http://localhost:8080/test/lookup/lookupTerritory/create.json',
                    method:'post'
                }
            }
        });
    My Reador is

    Code:
    var Area = Ext.data.Record.create([
        {name: 'areaName'},
        {
            name: 'areaName',
            type: 'string'
        }, {
            name: 'areaType',
            type: 'string'
        },{
            name: 'areaId',
            type: 'int'
        }]);
    Code:
    var reader = new Ext.data.JsonReader({
            totalProperty: 'total',
            successProperty: 'success',
            root: 'data'
           
        }, 
        Area);
    Writer code
    Code:
     var writer = new Ext.data.JsonWriter({
            encode: true,
            writeAllFields: true
        });
    Data Store is

    Code:
    var ds=new Ext.data.Store(    {
              proxy:proxy,
              reader:reader,
              writer: writer,  // <-- plug a DataWriter into the store just as you would a Reader
              autoSave: false 
           });
        
        ds.load();
    Save event method is
    Code:
    buttons: [{
                      text: 'Save All Data',
                      handler: function(){
                         ds.save();
                      }
                 }]
    the problem is , when I click on My Save All Data method the frame should be capable to attach the rowdata(s) as a request parameter , but my application is not able to send the rowdata(s) as a request Parameter.

    Can any one help in resolving this ASAP.

    Thank you in Advance

  2. #2
    Sencha Premium User mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    3,153

    Default

    Your API definition for your proxy only specifies read and create, by 'Saving' do you mean 'Creating'? If not you should add an 'update' command for your proxy API too.

Similar Threads

  1. not able to load grid using HttpProxy
    By braajkumar in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 9 Mar 2009, 2:30 PM
  2. [SOLVED] Grid HttpProxy Issue?
    By badgerd in forum Ext 1.x: Help & Discussion
    Replies: 9
    Last Post: 30 Aug 2007, 8:45 PM
  3. ComboBox HttpProxy DataStore issue
    By PFM in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 21 May 2007, 5:09 PM

Posting Permissions

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