M
M
malikan2015-04-23 19:44:48
JavaScript
malikan, 2015-04-23 19:44:48

ExtJS 5 + sockjs - how to link?

Hello everyone,
we need to remake a rather large interface on ExtJS 5, there is no one to ask.
I'm new to JS, please don't throw stones
. I don't understand anything on the sencha site at all.
Are there any sources to understand how to work with ExtJS at all?
Specifically, my task is to display the data received from the server in python tornado via sockjs.
No one to ask.
Let's say I have this code:

Ext.application({
    name   : 'MyApp',

    launch : function() {
        this.chatBox = Ext.widget({
            renderTo : Ext.getBody(),
            xtype    : 'grid',
            title    : 'Grid',
            width    : 650,
            height   : 300,
            plugins  : 'rowediting',
            store    : {
                fields : [ 'name', 'age', 'votes', 'credits' ],
                data   : [
                    [ 'Bill', 35, 10, 427 ],
                    [ 'Fred', 22, 4, 42 ]
                ]
            },
            columns: {
                defaults: {
                    editor : 'numberfield',
                    width  : 120
                },
                items: [
                    { text: 'Name', dataIndex: 'name', flex: 1, editor: 'textfield' },
                    { text: 'Age', dataIndex: 'age' },
                    { text: 'Votes', dataIndex: 'votes' },
                    { text: 'Credits', dataIndex: 'credits' }
                ]
            },

            connect : function() {
              // disconnect();

              conn = new SockJS('http://' + window.location.host + '/test');

              conn.onopen = function() {
                alert('Connected.');
                // update_ui();
              };

              conn.onmessage = function(e) {
                alert('Received: ' + e.data);
                // log('Received: ' + e.data);
              };

              conn.onclose = function() {
                alert('Disconnected.');
                conn = null;
                //update_ui();
              };
            }
        });
        this.chatBox.connect();
    }
});

It is necessary that the data below be obtained with sockJS
[ 'Bill', 35, 10, 427 ],
 [ 'Fred', 22, 4, 42 ]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan R, 2015-04-23
@neo55

I don't know about tostera, maybe there are few ext specialists here. The site stackoverflow.com always helps me with ekst and https://www.sencha.com/forum/forumdisplay.php?129-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question