Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: ExtJs and SingalR

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    221
    Answers
    10
    Vote Rating
    3
      0  

    Default ExtJs and SingalR

    Hi all,

    Please let me know if anyone has used SignalR library with ExtJS? Since SignalR is dependent on JQuery, does it create any issues?

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    There shouldn't be a technical reason why you should be able to use it. May require some extra work on your part to learn how to mix everything.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Aug 2011
    Posts
    51
    Vote Rating
    16
      1  

    Default

    I have Ext, jquery and signalR, all fine. Referencing jquery-1.6.4 that does the job.

  4. #4
    Sencha User Misiu's Avatar
    Join Date
    Jun 2012
    Location
    Poland
    Posts
    262
    Answers
    6
    Vote Rating
    79
      0  

    Default

    Quote Originally Posted by stevo.zilik View Post
    I have Ext, jquery and signalR, all fine. Referencing jquery-1.6.4 that does the job.
    @stevo - could You show us some code how to get those three speak together.
    I think that not only I will be grateful for some hints

  5. #5
    Sencha User
    Join Date
    Aug 2011
    Posts
    51
    Vote Rating
    16
      0  

    Default

    Quote Originally Posted by Misiu View Post
    @stevo - could You show us some code how to get those three speak together.
    I think that not only I will be grateful for some hints
    What exactly are you after? What I'm trying to say that those 3 libraries can coexist together without any problems.

    What do you do with messages comming from signalR is down to your business logic. I send json strings, deserialize them using Ext.deconde(...) and work with the objects, using Ext.js...

    Can you be more specific please

  6. #6
    Sencha User Misiu's Avatar
    Join Date
    Jun 2012
    Location
    Poland
    Posts
    262
    Answers
    6
    Vote Rating
    79
      0  

    Default

    What I was trying to say is could You show us how to connect to hub, receive and send messages from Ext.
    I know how to do that with jQuery, but for now I don't have idea how to do the same with Ext.

    With jQuery simplest usage would be:
    Code:
    <script type="text/javascript" src="~/Scripts/jquery.signalR-0.5.2.js"></script>
    <script type="text/javascript" src="SignalR/Hubs"></script>
    <script type="text/javascript">
            $(document).ready(function () {
                var chat = $.connection.chatHub;
                chat.writeMessage = function (msg) {
                    $("#messages").append("<li>" + msg + "</li>");
                }
    
    
                $("#buttonSubmit").click(function () {
                    chat.broadcastMessage($("#txtInput").val());
                });
    
    
                $.connection.hub.start();
            });
    </script>
    What would be great is to have this sample working with Ext, just a simple grid, textbox and button, that's all

  7. #7
    Sencha User
    Join Date
    Aug 2011
    Posts
    51
    Vote Rating
    16
      0  

    Default

    Oh well, you're looking for replacing all the signalR javasript written in jQuery for equivalent in Ext.js.

    Forget about it, not going to happen, at least not in the foreseeable future. It's quite complex and not stable enough for anyone to even try rewriting it, and the guys developing signalR have hands full with more important stuff than supporting a zillion of different javascript libraries. That's at least my opinion.

    Just use the jquery one, I'm using it too, it works fine, just inflates your page load by loading jquery...

  8. #8
    Sencha User Misiu's Avatar
    Join Date
    Jun 2012
    Location
    Poland
    Posts
    262
    Answers
    6
    Vote Rating
    79
      0  

    Default

    @Stevo I know that it would be extreme hard to replace signalr jQuery code with pure ExtJS.
    What I wanted to ask for is a basic example how to setup communication between jQuery, signalr and Ext.
    What I have in mind is just a simple Ext GUI and basic signalr code to communicate with that GUI.

  9. #9
    Sencha User
    Join Date
    Aug 2011
    Posts
    51
    Vote Rating
    16
      0  

    Default

    Quote Originally Posted by Misiu View Post
    @Stevo I know that it would be extreme hard to replace signalr jQuery code with pure ExtJS.
    What I wanted to ask for is a basic example how to setup communication between jQuery, signalr and Ext.
    What I have in mind is just a simple Ext GUI and basic signalr code to communicate with that GUI.
    I see. Well my scenario is very specific, I'm not even using hubs and have a loads of javascript code around it...

    The code that you posted looks fine, just use it inside an Ext.onReader(...) and then use the $.connection object to send messages in a button handler, should be easy to get working.

  10. #10
    Sencha Premium Member
    Join Date
    Feb 2013
    Posts
    3
    Vote Rating
    0
      0  

    Wink also pursuing a solution with ExtJS and SignalR

    I've just begun a similar quest.. am interested in comparing notes if you have any to share.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •