Problem with Dynamic window, store and grid

  1. #1

    Problem with Dynamic window, store and grid

    Hi,

    I'm trying to pop up new window from DirectMethod, Here is the code:
    [DirectMethod]
    public void CreateNewMBOWindow(string symbol)
            {
                Ext.Net.Window w = new Window("MBO - " + symbol);
                w.Width = 420;
                w.Height = 300;
                w.Layout = "HBox";            
                w.ID = "wndMBO" + symbol;
                w.IDMode = IDMode.Explicit;
                w.CloseAction = CloseAction.Destroy;
    
                Store bidPriceStore = new Store();
                bidPriceStore.ID = "strMboBidSide" + symbol;
                bidPriceStore.IDMode = IDMode.Explicit;
                bidPriceStore.Reader.Add(new JsonReader());
                bidPriceStore.Model.Add(new Model());
                bidPriceStore.AddField(new ModelField("Position", ModelFieldType.Int));
                bidPriceStore.AddField(new ModelField("Volume", ModelFieldType.Int));
                bidPriceStore.AddField(new ModelField("Price", ModelFieldType.Float));
    
                GridPanel bidGrid = new GridPanel();
                bidGrid.Width = 210;
                bidGrid.ID = "grpMboBidSide" + symbol;
                bidGrid.Store.Add(bidPriceStore);
                Column col = new Column();
                col.Text = "Bid Volume";
                col.DataIndex = "Volume";
                bidGrid.ColumnModel.Columns.Add(col);
                col = new Column();
                col.Text = "Bid Price";
                col.DataIndex = "Price";
                bidGrid.ColumnModel.Columns.Add(col);
                w.Items.Add(bidGrid);
                w.Render();
    
                bidPriceStore.Data = State.SymbolControler.Instance.Find(x => x.SymbolCode == symbol).BidOrderList;
            }
    Every thing is OK, except that there is no data displayed in Grid. I can see that the grid is binding whit data and after very short interval of time grid is getting empty. After this i'm sending data via SignalR and grid is woring OK.

    Thanks in advance,

    Boris
  2. #2
    You have to set Data before window rendering
  3. #3
    Thanks Vladimir, I wasn't seeing obvious thing.

Similar Threads

  1. Problem For Creating New Dynamic Window
    By softlabsgroup.support in forum 1.x Help
    Replies: 0
    Last Post: May 19, 2012, 11:14 AM
  2. Replies: 12
    Last Post: Sep 20, 2011, 2:33 PM
  3. Replies: 0
    Last Post: Mar 04, 2011, 6:46 AM
  4. Replies: 1
    Last Post: Feb 24, 2010, 3:05 PM
  5. Dynamic store and grid problem
    By Varlynstroud in forum 1.x Help
    Replies: 2
    Last Post: Aug 19, 2009, 11:03 AM

Posting Permissions