1. #21
    Sencha User
    Join Date
    Oct 2012
    Posts
    6
    Vote Rating
    2
    okello is on a distinguished road

      1  

    Default Using WebSocket extension to upload files

    Using WebSocket extension to upload files


    Hi @Wilky. This extension is great. I was just wondering if it's possible to use it to upload files to a socket server, something similar what this extension does.

  2. #22
    Sencha User
    Join Date
    May 2011
    Location
    Italy
    Posts
    72
    Vote Rating
    7
    Wilky is on a distinguished road

      0  

    Default


    @okello: Thanks! Yeah, I think it could be an interesting feature! I'll give it a look as soon as possible Thanks for the suggestion!

  3. #23
    Sencha User
    Join Date
    Jul 2013
    Posts
    7
    Vote Rating
    1
    Sirisian is on a distinguished road

      0  

    Default


    Does this work with TreeStore? I got it to work with node.js's ws module using your grid example so I decided to test out the TreeStore and got an error:

    InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable
    this.ws.send (Ext.JSON.encode (msg));
    WebSocket.js line 454
    The error happens even before the socket connects. I can have my socket server turned off and I see this error instantly when I refresh the page. This indicates that with tree store it tries to use the proxy before the connection is available to send anything.

    I followed the extjs 4 documentation, but maybe I setup something wrong.

    Code:
        Ext.require (["*"]);
    
        Ext.Loader.setConfig(
        {
            enabled: true
        });
    
        Ext.onReady(function()
        {
            Ext.define("players",
            {
                extend: "Ext.data.Model",
                fields:
                [
                    {
                        name: "name",
                        type: "string"
                    },
                    {
                        name: "width",
                        type: "int"
                    },
                    {
                        name: "height",
                        type: "int"
                    },
                    {
                        name: "timezone",
                        type: "int"
                    }
                ],
                proxy:
                {
                    type: "websocket",
                    storeId: "playersStore",
                    url: "wss://domain.com/node.js",
                    api:
                    {
                        create: "createPlayers",
                        read: "readPlayers",
                        update: "updatePlayers",
                        destroy: "destroyPlayers"
                    },
                    reader:
                    {
                        type: "json",
                        root: "children"
                    }
                }
            });
    
            var playersStore = Ext.create("Ext.data.TreeStore",
            {
                model: "players",
                storeId: "playersStore",
                folderSort: true
            });
    
            var tree = Ext.create("Ext.tree.Panel",
            {
                title: "Players",
                width: 500,
                height: 300,
                renderTo: Ext.getBody(),
                collapsible: true,
                useArrows: true,
                rootVisible: false,
                store: playersStore,
                columns:
                [
                    {
                        xtype: "treecolumn",
                        text: "Name",
                        flex: 2,
                        sortable: true,
                        dataIndex: "name"
                    },
                    {
                        text: "Width",
                        flex: 1,
                        dataIndex: "width",
                    },
                    {
                        text: "Height",
                        flex: 1,
                        dataIndex: "height",
                    },
                    {
                        text: "Time Zone",
                        flex: 1,
                        dataIndex: "timezone",
                    }
                ]
            });
    Issue I submitted.

  4. #24
    Sencha User
    Join Date
    May 2010
    Posts
    5
    Vote Rating
    0
    mickarea is on a distinguished road

      0  

    Default plugin + sencha cmd

    plugin + sencha cmd


    Hi ... I'm trying to include this plugin to my project. I put the folder ux in my project-folder/ext .
    So, I've now in my project folder => ext\ux\data\proxy\WebSocket.js

    when i run the command sencha app build, it said, faild to resolve package ext.ux.data.proxy.websocket


    do you have an idea why ?

    sencha cmd v4.0.1.45

    thx,

  5. #25
    Sencha User
    Join Date
    May 2010
    Posts
    5
    Vote Rating
    0
    mickarea is on a distinguished road

      0  

    Default


    I finally manage to get it work, but i've :


    Failed to execute 'send' on 'WebSocket': already in CONNECTING state.

  6. #26
    Sencha Premium Member
    Join Date
    Apr 2007
    Posts
    92
    Vote Rating
    61
    bobmanc is a jewel in the rough bobmanc is a jewel in the rough bobmanc is a jewel in the rough bobmanc is a jewel in the rough

      0  

    Default


    I am just starting to work with websockets so i don't know much about them yet. Would this create a new websocket connection for each store then?

  7. #27
    Ext JS Premium Member
    Join Date
    Sep 2009
    Posts
    86
    Vote Rating
    6
    HyGy is on a distinguished road

      0  

    Default automatic update of data sent by the server

    automatic update of data sent by the server


    Hi!

    I downloaded the websocketed grid example. Created a little nodejs server to serv the client, and it is working. If i press the read it reads the data, update sends back to server.

    But what I need to send from the server to client to regularly automatically update the grid without pressing any button?

    thanks
    HyGy

  8. #28
    Sencha User
    Join Date
    Jun 2014
    Posts
    11
    Vote Rating
    38
    nicklaros has a spectacular aura about nicklaros has a spectacular aura about

      0  

    Default


    Hi, is it me or anyone else had this issue.. I'm using this WebSocket proxy and it's great until I had this problem.

    why the proxy extraParams not sent to server?
    note that I'm 100% sure extraParams is there but the request sent to server did not include that extraParams. for the sake of clarity this is my extraParams after calling mystore.getProxy().extraParams
    Code:
    
    {nama: "kecap", kode: "l"}
    but it only send this request to server
    Code:
    {"event":"stock/read","data":{"sort":[{"property":"name","direction":"ASC"}],"page":1,"limit":200,"start":0}}
    Note:
    - I'm using ExtJS 5.0.1
    Last edited by nicklaros; 16 Aug 2014 at 5:57 PM. Reason: add note

  9. #29
    Sencha User
    Join Date
    Aug 2014
    Posts
    27
    Vote Rating
    0
    Richardmansfield is on a distinguished road

      0  

    Default


    Hi! nicklaros shall I know the version and the name of the browser you are using this plugin.

  10. #30
    Ext JS Premium Member
    Join Date
    Aug 2014
    Posts
    1
    Vote Rating
    0
    rashed_mohammed@bah.com is on a distinguished road

      0  

    Default Ext.ux.WebSocket.receiveEventMessage(): (No description provided) error

    Ext.ux.WebSocket.receiveEventMessage(): (No description provided) error


    Hello, I am trying to use the WebSocket plugin with Ext 4.2.2. I can see the data coming back correctly but the script fails with the above error in the completeTask: function (action, event, data) function at the following line.
    var me = this , resultSet = resultSet = me.reader.read (data);

    the date is coming from the server as below.


    [Object]
    • 0: Object
      • id: "1234"
      • name: "Rashed"
      • riskfactor: "yes"

    Console statement shows that it is failing at the read method. The error n detail is:
    • [COLOR=red !important][E] Ext.ux.WebSocket.receiveEventMessage(): (No description provided) ext-dev.js:12883[/COLOR]
      • [COLOR=red !important]log[/COLOR]ext-dev.js:12883
      • [COLOR=red !important]Ext.Error.Ext.extend.statics.raise[/COLOR]ext-dev.js:11979
      • [COLOR=red !important]Ext.define.receiveEventMessage[/COLOR]ext/src/ux/WebSocket.js:452
      • [COLOR=red !important](anonymous function)

        [/COLOR]
    TypeError
    • message: "undefined is not a function"
    • sourceClass: "Ext.ux.WebSocket"
    • sourceMethod: "receiveEventMessage"