Store fills with whole object schema

  1. #1

    Store fills with whole object schema

    Hello there,

    I have the above store
      <ext:Store ID="StoreCovers" PageSize="20" OnReadData="StoreCovers_ReadData" runat="server">
                    <Model>
                        <ext:Model ID="ModelCovers"  runat="server" >
                            <Fields>
                                <ext:ModelField Name="ID" />
                                <ext:ModelField Name="CompanyID" />
                                <ext:ModelField Name="BranchID" />
                                <ext:ModelField Name="SubBranchID" />
                                <ext:ModelField Name="CoverDescription" />
                                <ext:ModelField Name="Active" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
    and i am binding with a list of the above class data

      public int ID { get; set; }
            public object Code { get; set; }
            public int? CompanyID { get; set; }
            public object CoverDescription { get; set; }
            public int? StatusID { get; set; }
            public int? UserID { get; set; }
            public object UserTerminal { get; set; }
            public object LastChangeDate { get; set; }
            public int Active { get; set; }
            public int BranchID { get; set; }
            public int SubBranchID { get; set; }
            public int? Gravity { get; set; }
            public int GroupID { get; set; }
            public int? ClaimObjectTypeID { get; set; }
            public int LanguageID { get; set; }
            public List<CoversAssistData> assist { get; set; }
            public List<CoversPredictionsData> predictionValues { get; set; }
            public CoverSapData sap { get; set; }
            //public int? AssistSubranch { get; set; }
            //public DateTime? AssistSubranchDateFrom { get; set; }
            public List<TranslationsData> Translations { get; set; }
    When i am getting data from the store, the store has the whole schema as json. But my model has only 5 fields. Is there any way to fill the store only with the data of the model?
  2. #2
    Hello @asteriskgr!

    Your question is not very clear to me but maybe one of these examples are doing exactly what you need:
    - Grid Panel - Server data mapping
    - Grid Panel - Field mapping

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3

    Store fills with whole object schema

    Hello there,

    My question is that my class (which i wand to bound to the store) may have 100 properties. In my store i want to have only five. When i am binding my list<class> with the store i see in javascript that the store has all the 100 fields of my class null despite of the fact than in the model i have defined only 5. I could create a sub class with the five fields but why to do that if the store could. The bad for me is that the size of the store object (because it has 100 fields null) is big with no reason.
  4. #4
    Hello, asteriskgr!

    The server-side fields must bind to the client-side at some point -- in the client's web browser. If you don't want the several fields out to the client side, you have to use a server-side model matching your 5 fields and do the mapping from server side.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Loading Advanced XML Schema into TreePanel
    By mrVan in forum 2.x Help
    Replies: 17
    Last Post: May 02, 2015, 7:28 PM
  2. Replies: 2
    Last Post: Feb 20, 2015, 3:58 PM
  3. [CLOSED] DB Schema for Calendar
    By rthiney in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 30, 2014, 8:41 PM
  4. Replies: 2
    Last Post: Jun 13, 2013, 3:58 PM
  5. [CLOSED] GridPanel / Store schema
    By methode in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Jan 13, 2009, 3:43 PM

Tags for this Thread

Posting Permissions