Store.DataBind() from javascript ?

  1. #1

    [CLOSED] Store.DataBind() from javascript ?

    Hi,

    Is there a method like myStore.DataBind() that I can call in javascript ?

    Cheers :)
    Last edited by Fractal; Jun 14, 2013 at 7:02 AM.
  2. #2
    Quote Originally Posted by Fractal View Post
    Hi,

    Is there a method like myStore.DataBind() that I can call in javascript ?

    Cheers :)
    I have used below method:
     <ext:Button Width="70" Height="30" ID="Button13" runat="server" Text="Bind">
    <Listeners>
         <Click Handler="#{myStore}.load();">
         </Click>
    </Listeners>
    </ext:Button>
    Try this
    "#{myStore}.load();"
    in your code
  3. #3
    Thanks for your answer kavit, unfortunately it does not work.
  4. #4
    Quote Originally Posted by Fractal View Post
    Thanks for your answer kavit, unfortunately it does not work.
    Can you post your sample code?? so I can help you better way..
  5. #5
    This is a simple signalr script that create a notification on the 'addMessage' event. I would like to reload the store as well.

        <script>
    
            $(document).ready(function () {
                
                $.connection.hub.url = "http://mydomain.fr/signalr";
                var proxy = $.connection.hub.createHubProxy("myHub");
                proxy.on('addMessage', function (message) {
    
                    Ext.net.Notification.show({
                        hideFx: {
                            args: ['r', {}],
                            fxName: 'slideOut'
                        },
                        showFx: {
                            args: ['b', {}],
                            fxName: 'slideIn'
                        },
                        pinEvent: 'click',
                        html: message,
                    });
                    // If I try to add #{myStore}.reload(); the page never loads on init.
                });
    
                $.connection.hub.start().done(function () {
    
                });
            });
    
        </script>
  6. #6
    Quote Originally Posted by Fractal View Post
    This is a simple signalr script that create a notification on the 'addMessage' event. I would like to reload the store as well.

        <script>
    
            $(document).ready(function () {
                
                $.connection.hub.url = "http://mydomain.fr/signalr";
                var proxy = $.connection.hub.createHubProxy("myHub");
                proxy.on('addMessage', function (message) {
    
                    Ext.net.Notification.show({
                        hideFx: {
                            args: ['r', {}],
                            fxName: 'slideOut'
                        },
                        showFx: {
                            args: ['b', {}],
                            fxName: 'slideIn'
                        },
                        pinEvent: 'click',
                        html: message,
                    });
                    // If I try to add #{myStore}.reload(); the page never loads on init.
                });
    
                $.connection.hub.start().done(function () {
    
                });
            });
    
        </script>
    is this addMessage' event is <DirectEvent>?
  7. #7
    Have you wrapped this script in an XScript section, token replacement #{} only works in XScript sections or within ext markup.
    Also use Firefox and either open up Web Developer Tools or get Firebug, see what the error is via the console.
    Look at the actual HTML in firebug and check that the store token is replaced with something like App.mystore.

    Haven't tried SignalR, pretty cool stuff but have no need for it yet.

                    <ext:Container ID="cntScript" runat="server">
                        <HtmlBin>
                            <ext:XScript ID="xScript" runat="server">
                                <script type="text/javascript">
                                    $(document).ready(function () {
    
                                        $.connection.hub.url = "http://mydomain.fr/signalr";
                                        var proxy = $.connection.hub.createHubProxy("myHub");
                                        proxy.on('addMessage', function (message) {
    
                                            Ext.net.Notification.show({
                                                hideFx: {
                                                    args: ['r', {}],
                                                    fxName: 'slideOut'
                                                },
                                                showFx: {
                                                    args: ['b', {}],
                                                    fxName: 'slideIn'
                                                },
                                                pinEvent: 'click',
                                                html: message,
                                            });
                                            // If I try to add #{myStore}.reload(); the page never loads on init.
                                           #{myStore}.reload();
                                        });
    
                                        $.connection.hub.start().done(function () {
    
                                        });
                                    });
                                </script>
                            </ext:XScript>
                        </HtmlBin>
                    </ext:Container>
  8. #8
    Thank you ItcTech, wrapping my script in the Xscript and Container fixed my issue ^^

Similar Threads

  1. [CLOSED] DataBind store to a dictionary?
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 17, 2013, 1:04 AM
  2. Store DataBind in DirectEvents
    By threewonders in forum 1.x Help
    Replies: 1
    Last Post: Nov 03, 2011, 10:04 AM
  3. [1.0] Store.LoadData vs DataBind
    By Kam in forum 1.x Help
    Replies: 1
    Last Post: Apr 19, 2011, 11:00 AM
  4. fasten databind to store
    By Birgit in forum 1.x Help
    Replies: 0
    Last Post: Sep 15, 2010, 7:04 AM
  5. Problem with Store.DataBind
    By flaviodamaia in forum 1.x Help
    Replies: 0
    Last Post: Nov 20, 2009, 9:22 AM

Tags for this Thread

Posting Permissions