Results 1 to 6 of 6

Thread: ScriptTagProxy and JsonStore

  1. #1
    Sencha User
    Join Date
    Jul 2010
    Posts
    304

    Default ScriptTagProxy and JsonStore

    Hi,

    I use a ScriptTagProxy for a jsonStore this way

    Code:
            var remoteGridProxy = new Ext.data.ScriptTagProxy({
                api:{
                    read: { url : '../secure/getSubjectDataGrid.htm', method: 'POST' },
                    create: { url : '../secure/createSubjectDataGrid.htm', method: 'POST' },
                    update: { url : '../secure/updateSubjectDataGrid.htm', method: 'POST' },
                    destroy: { url : '../secure/deleteSubjectDataGrid.htm', method: 'POST' }
                }
            });
    Code:
            var remoteGridJsonStore = new Ext.data.JsonStore({
                proxy: remoteGridProxy,
                baseParams: { pageId: id, subjectId: subjectId, gridNum: gridNbr, sptNbr: (sptNbr+1), screenSequence: screenSequence },
                storeId: 'remoteGridJsonStore_'+sptNbr+'_'+gridNbr,
                root: 'records',
                autoLoad: false,
                totalProperty: 'totalCount',
                remoteSort: false,
                fields: gridFields,
    I have two questions

    1)Unhappily the requests are sent with a 'GET' method. So I didn't use the right syntax. How can I send them with a POST method

    2) Furthermore some gridFields are not sent to the server. Maybe when the value has not changed the Ext.data.Field is not sent to the server ?How can I force the store to send every Ext.data.Field ?

    Thank you in advance for your answers

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

    Default

    You cannot do a POST with such a proxy, remember - behind the scenes it's just a script tag added to the page.

  3. #3
    Sencha User
    Join Date
    Jul 2010
    Posts
    304

    Default

    Hi mankz and thank you for your answer,

    so how can I use read, update, create, destroy using a POST method ? Is there another way ?

  4. #4
    Sencha User
    Join Date
    Jul 2010
    Posts
    304

    Default

    Hi,
    the problem is that I send too many datas to the server (more than 6000 characters) and it gives me a 400 Bad request error. So I must use the POST method

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

    Default

    Then don't use ScriptTagProxy!

    You don't need to, you are using a relative URL.

  6. #6
    Sencha User
    Join Date
    Jul 2010
    Posts
    304

    Default

    Hi animal and thank you for your answer,

    I tried this :

    Code:
            var remoteGridProxy = new Ext.data.HttpProxy({
                api:{
                    read: { url : '../secure/getSubjectDataGrid.htm', method: 'GET' },
                    create: { url : '../secure/createSubjectDataGrid.htm', method: 'POST' },
                    update: { url : '../secure/updateSubjectDataGrid.htm', method: 'POST' },
                    destroy: { url : '../secure/deleteSubjectDataGrid.htm', method: 'POST' }
                }
            });
    But it doesn't work

    Could anyone can give me an example of what I should implement ?

    I have at least to send the request for update and create with a POST method

Similar Threads

  1. How to get requested url from JsonStore when ScriptTagProxy is used
    By pAq85 in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 18 Nov 2010, 1:49 AM
  2. Param with a scriptTagProxy CRUD api/JsonStore
    By Aero in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 18 Jul 2010, 9:55 PM
  3. empty JsonStore with ScriptTagProxy
    By Robert82 in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 10 Mar 2010, 4:18 AM
  4. empty JsonStore with ScriptTagProxy
    By Robert82 in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 10 Mar 2010, 3:15 AM
  5. ScriptTagProxy not populating JsonStore
    By locutusUT in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 24 Nov 2009, 11:17 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
  •