[CLOSED] Example of LocalStorageProxy

  1. #1

    [CLOSED] Example of LocalStorageProxy

    Hi all,

    I would like to manage the content a of a combobox with a LocalStorageProxy, but honestly I haven't understood
    very well how to do it. I haven't found any complete example and really it's a bit of mistery at the moment for me.

    Can you please provide an example of how I should fill in the values in the combobox?

    This is the store:
    <ext:Store ID="StatusStore" runat="server">
                <Model>
                    <ext:Model runat="server" ID="statusStoreModel" IDProperty="Id">
                        <Fields>
                            <ext:ModelField Name="Id" />
                            <ext:ModelField Name="Status" />
                        </Fields>
                        <Proxy>
                    <ext:LocalStorageProxy StorageID="mylocalstorage"></ext:LocalStorageProxy>                   
                </Proxy>  
                    </ext:Model>
                </Model>
                            
            </ext:Store>
    This is the combo:

    <ext:ComboBox runat="server" ID="SearchStatusComboBox" StoreID="StatusStore" DisplayField="Status" ValueField="Id"> 
    </ext:ComboBox>
    but then....what I have to do?

    Thank you!!!!
    Last edited by Daniil; Oct 24, 2013 at 7:15 AM. Reason: [CLOSED]
  2. #2
    Hi Alessandra,

    Here is an example.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html>
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <ext:Store ID="StatusStore" runat="server">
                <Model>
                    <ext:Model runat="server" ID="statusStoreModel" IDProperty="Id">
                        <Fields>
                            <ext:ModelField Name="Id" />
                            <ext:ModelField Name="Status" />
                        </Fields>
                        <Proxy>
                            <ext:LocalStorageProxy StorageID="mylocalstorage" />
                        </Proxy>
                    </ext:Model>
                </Model>
            </ext:Store>
    
            <ext:Button runat="server" Text="Add one" Handler="App.StatusStore.add({ Id: 'id1', Status: 'status 1'});" />
    
            <ext:Button runat="server" Text="Add another" Handler="App.StatusStore.add({ Id: 'id2', Status: 'status 2'});" />
    
            <ext:ComboBox 
                runat="server" 
                StoreID="StatusStore"
                DisplayField="Status"
                ValueField="Id" />
    
        </form>
    </body>
    </html>
  3. #3
    Thank you!!

Posting Permissions