[CLOSED] Way to tell store to reaload data but only if circumstances are met

Page 4 of 5 FirstFirst ... 2345 LastLast
  1. #31
    Quote Originally Posted by Daniil View Post
    Please post a piece of code where you do that.
    <%@ Page Language="C#" %>
    <%@ Register TagPrefix="ext" Namespace="Ext.Net" Assembly="Ext.Net, Version=1.5.0.0, Culture=neutral, PublicKeyToken=2e12ce3d0176cd87" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script runat="server">
        protected void Click(object sender, DirectEventArgs e)
        {
            Ext.Net.X.Msg.Alert("Clicked!", "Here my new item apear to be added on serverside").Show();
        }
    </script>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Details for test</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <ext:ResourceManager runat="server"/>
            <ext:Viewport runat="server">
                <Items>
                    <ext:Button runat="server" ID="btnTest" Text="Click me!">
                        <DirectEvents>
                            <Click OnEvent="Click"></Click>
                        </DirectEvents>
                    </ext:Button>
                </Items>
            </ext:Viewport>
        </div>
        </form>
    </body>
    </html>
    That's code which is inside iframe of window.
  2. #32
    I can't see where you add an item to the ComboBox.
  3. #33
    Quote Originally Posted by Daniil View Post
    I can't see where you add an item to the ComboBox.
    combobox is existing in parent page of window with this iframe inside of.

    Main Question is how to tell this comboBox to reload store (here's new item will be added) and then set value of new added item it will be int most of the time ? Is it possible?
  4. #34
    Well, as I mentioned before, this way:
    protected void Click(object sender, DirectEventArgs e)
    {
        X.Js.AddScript("parent.ComboBox.getStore.reload();");
    }
    You just need to generate respective JavaScript code as I suggested here:
    http://forums.ext.net/showthread.php...ll=1#post98393
  5. #35
    Quote Originally Posted by Daniil View Post
    Well, as I mentioned before, this way:
    protected void Click(object sender, DirectEventArgs e)
    {
        X.Js.AddScript("parent.ComboBox.getStore.reload();");
    }
    You just need to generate respective JavaScript code as I suggested here:
    http://forums.ext.net/showthread.php...ll=1#post98393
    Now I think I understand but 1 more question just to be clear
    protected void Click(object sender, DirectEventArgs e)
    {
        X.Js.AddScript("parent.ComboBox.getStore.reload();");
    }
    should I add before creating window or after?
  6. #36
    Well, this handler is within an iframe page. So, I don't understand your question well. Please clarify.
  7. #37
    Quote Originally Posted by Daniil View Post
    Well, this handler is within an iframe page. So, I don't understand your question well. Please clarify.
    Can I do this with asp:Button also? I have made sample with ext:Button but in my app i got asp:Button :(

    And where should I do this?
    http://forums.ext.net/showthread.php...ll=1#post98393
  8. #38
    Quote Originally Posted by Daniil View Post
    Well, this handler is within an iframe page. So, I don't understand your question well. Please clarify.
    then where should I put this?
    var combo = parent.ComboBox1;
     
    combo.getStore().reload({
        callback: function () {
            combo.setValue('value');
        }
    });
    i have make it like that (after add new item):
    Ext.Net.X.Js.Call("parent.ComboBox1.getStore().reload({ callback: function () { parent.ComboBox1.setValue('value'); }});");
    Last edited by ViDom; Dec 15, 2012 at 9:39 AM.
  9. #39
    You should use the AddScript method as I demonstrated. And, seems, you forget this piece of code:
    var combo = parent.ComboBox1;
    In your script "combo" will be undefined in the callback.
  10. #40
    Quote Originally Posted by Daniil View Post
    You should use the AddScript method as I demonstrated. And, seems, you forget this piece of code:
    var combo = parent.ComboBox1;
    In your script "combo" will be undefined in the callback.
    Oh ok I will try it and let you know :)
    What is the difference between Call and AddScript methods then?
Page 4 of 5 FirstFirst ... 2345 LastLast

Similar Threads

  1. Replies: 0
    Last Post: Apr 22, 2012, 9:39 AM
  2. Replies: 1
    Last Post: Mar 08, 2012, 2:52 PM
  3. Replies: 5
    Last Post: May 17, 2011, 9:10 AM
  4. Replies: 5
    Last Post: Nov 26, 2010, 5:39 PM
  5. [CLOSED] Data Store deriving invalid data variable name
    By SFritsche in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 15, 2009, 12:31 PM

Tags for this Thread

Posting Permissions