[CLOSED] Javascript: Adding Dynamic Field to the Store and Creating Dynamic Column for the grid

Page 2 of 2 FirstFirst 12
  1. #11
    Hi Daniil,

    Do you need to copy all fields from one store to another, right?
    No

    I want to create a Grid store as Below
    <Store>                 
                                            <ext:Store ID="gridstore1" runat="server">                     
                                                <Reader>                         
                                                    <ext:ArrayReader>                             
                                                        <Fields>                                 
                                                            <ext:RecordField Name="Shelf" />
                                                            <ext:RecordField Name="Row" />       
                                                            <ext:RecordField Name="Bin" />                                    
                                                        </Fields>                         
                                                    </ext:ArrayReader>                     
                                                </Reader>                 
                                            </ext:Store>             
                                        </Store>
    with the help of My Javascript code.

    But i have other problem, ie, i am constructing a string with the values as
    {Shelf:Shelf1,Row:row1,Bin:Bin1}
    And assign to a
    Var str
    when i do
    gridstore1.addRecord({Shelf:'shelf1',Row:'Row1',Bin:'Bin1'});
    the values are stored in there respective fields

    But when i do
    gridstore1.addRecord(str);
    the values in the store for the respective flelds is empty

    Please let me know what could be the problem...

    Thank You
  2. #12
    Quote Originally Posted by Shanth View Post
    But i have other problem, ie, i am constructing a string with the values as
    {Shelf:Shelf1,Row:row1,Bin:Bin1}
    And assign to a
    Var str
    If I correctly understand it looks this way:
    var str = "{Shelf:Shelf1,Row:row1,Bin:Bin1}";
    Yes, .addRecord() expects an object with respective properties, not a string object.

    You should modify your string this way:
    var str = "{Shelf:'Shelf1',Row:'row1',Bin:'Bin1'}";
    and decode it:
    store.addRecord(Ext.decode(str));
  3. #13
    Thank You, it worked....

    Sorry, i was doing this....
    You should modify your string this way:
    1 var str = "{Shelf:'Shelf1',Row:'row1',Bin:'Bin1'}";
    But i was not decoding it
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 2
    Last Post: Sep 27, 2011, 7:25 AM
  2. [CLOSED] Problem Creating Dynamic Header column for filter
    By legaldiscovery in forum 1.x Legacy Premium Help
    Replies: 12
    Last Post: Jun 23, 2011, 6:59 AM
  3. Replies: 0
    Last Post: Jun 21, 2011, 12:18 PM
  4. Replies: 0
    Last Post: Mar 04, 2011, 6:46 AM
  5. Replies: 0
    Last Post: Apr 23, 2009, 7:43 AM

Posting Permissions