Skip to content

Commit

Permalink
stop using websocket URL as panel id (fix wilk#12)
Browse files Browse the repository at this point in the history
It is incompatible with later versions of Ext JS.
  • Loading branch information
richard-vd committed Sep 29, 2015
1 parent c971156 commit 3e9e171
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ Ext.define ('DEMO.view.OpenConnection', {
url: url ,
listeners: {
open: function (ws) {
if (Ext.get(ws.url)) Ext.get(ws.url).dom.innerHTML += '> WebSocket just open!<br/>';
var container = Ext.ComponentQuery.query('panel[title="' + url + '"] > container#messageCt')[0];
var messageBox = container.getEl().dom.getElementsByClassName("messageBox")[0];
messageBox.innerHTML += '> WebSocket just open!<br/>';
} ,
message: function (ws, data) {
Ext.get(ws.url).dom.innerHTML += '> ' + data + '<br/>';
var container = Ext.ComponentQuery.query('panel[title="' + url + '"] > container#messageCt')[0];
var messageBox = container.getEl().dom.getElementsByClassName("messageBox")[0];
messageBox.innerHTML += '> ' + data + '<br/>';
} ,
close: function (ws) {
var panel = Ext.getCmp ('panel' + ws.url);
var panel = Ext.ComponentQuery.query('panel[title="' + url + '"]')[0];

if ((panel != null) || (panel != undefined)) {
panel.destroy ();
Expand All @@ -41,7 +45,6 @@ Ext.define ('DEMO.view.OpenConnection', {
var panel = Ext.create ('Ext.panel.Panel', {
title: url ,
ws: ws ,
id: 'panel' + url ,

layout: 'anchor' ,

Expand All @@ -50,7 +53,8 @@ Ext.define ('DEMO.view.OpenConnection', {

items: [{
xtype: 'container' ,
html: 'Incoming from the server:<br/><div id="' + url + '" style="height: 60px; border: black solid 1px; padding: 5px; margin: 5px 0 5px 0; overflow: auto"></div>'
html: 'Incoming from the server:<br/><div class="messageBox" style="height: 60px; border: black solid 1px; padding: 5px; margin: 5px 0 5px 0; overflow: auto"></div>' ,
itemId: 'messageCt'
} , {
xtype: 'textarea' ,
labelAlign: 'top' ,
Expand Down

0 comments on commit 3e9e171

Please sign in to comment.