Answer the question
In order to leave comments, you need to log in
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();
}
});
[ 'Bill', 35, 10, 427 ],
[ 'Fred', 22, 4, 42 ]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question