JSON encode records of a store

  1. #1

    JSON encode records of a store


    I maintain a store without any relevant grid (it is used behind a form) and I wish to encode all of its records in order to submit them as an AJAX event parameter. In the case of a grid I would have used:

    <ext:Parameter Name="Parameter1" Value="Ext.encode(#{GridPanel1}.getRowsValues(false))" Mode="Raw" />
    How could I accomplish that?

    Thanks

    Wtower

  2. #2

    RE: JSON encode records of a store


    Sorry I forgot to mention that if I attempt to encode the store itself or even a specific record of it, I get an error on Firebug: "too many recursions".

    Moreover, I tried to encode getForm().getValues() both as an object or as a string, but then when I deserialize the parameter on server I get an exception: "Could not cast or convert from System.String to System.Nullable`1 [System.Int32]".

    The values are all validated so I believe that possibly the form does not maintain field type information as a store does, and this is why I am trying to do that through a store. Of course I have tried to deserialize store values out of grid for the same record and it works perfect.

  3. #3

    RE: JSON encode records of a store

    Hi,

    The Store has the same function - 'getRecordsValues'
  4. #4

    RE: JSON encode records of a store


    Brilliant. Many thanks!

Similar Threads

  1. Replies: 1
    Last Post: Dec 22, 2011, 6:17 AM
  2. Replies: 5
    Last Post: Jun 14, 2011, 11:47 AM
  3. Replies: 1
    Last Post: Nov 01, 2010, 9:00 PM
  4. Get Store records
    By walle in forum 1.x Help
    Replies: 4
    Last Post: Jul 17, 2010, 5:19 PM
  5. [CLOSED] [1.0] Ext.encode and JSON.Deserialize
    By state in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 14, 2010, 8:03 AM

Posting Permissions