PDA

View Full Version : Extjs 4 window



tina@user
17 Dec 2015, 1:36 AM
Hi,

i have created a extjs 4 grid inside a window. On click of a grid column another window pops up.
var playerwin;
if(!playerwin){
playerwin = Ext.create('App.view.VideoPlayer');
}
playerwin.show();

I have integrated jwPlayer inside window.


Ext.define('App.view.VideoPlayer', {
extend : 'Ext.window.Window',
alias:'widget.VideoPlayer',
minimizable : false,
resizable : false,
id : 'playerId',
bodyPadding : 10,
width : 560,
height : 560,
cls:'videoWindowCls',
draggable : false,
modal : true,
closeAction : 'destroy',
buttonAlign : 'center',
tbar : [ {
xtype : 'label',
text : 'Player'
} ],

items : [ {
xtype : 'panel',
id : 'ContainerId',
} ],
listeners : {
afterrender : function() {
jwplayer('ContainerId').setup({
width : 525,
height : 500,
file: "URL",
rtmp: {
bufferlength: 0.05
}
});
}
}
})


the problem is whenever i close the video window after playing the player , the window doesnt closes.
Instead it shows something like this attachment:-
53775

I dont know where i am going wrong.
please help

thanx in advance!!

jdkhamba
17 Dec 2015, 1:59 AM
Not familiar with jwplayer but looks like the setup is happening on some DOM element called ''ContainerId'' but the id of the window is different called 'playerId'. Maybe that is causing the issue?

tina@user
20 Dec 2015, 11:31 PM
the "playerId" is of the window and "ContainerId" is the id of the panel inside which i am inserting the jwplayer.

Do i need to explicitly destroy the panel and the window...??
Coz the panel is inside the window...

jdkhamba
21 Dec 2015, 4:54 AM
The problem is with the jwplayer i believe as the panel will get automatically destroyed on destroying the window. Try listening to beforedestroy event of the window or panel and explicitly destroy the jwplayer if possible.

tina@user
23 Dec 2015, 12:34 AM
hi,

the problem is not with the player coz if i remove the player and put a simple panel, problem persists .



//VideoWindow
Ext.define('App.view.VideoPlayer', {
extend : 'Ext.window.Window',
alias:'widget.VideoPlayer',
minimizable : false,
resizable : false,
floating: true,
id : 'recordedplayerId',
bodyPadding : 10,
width : 560,
height : 560,
cls:'videoWindowCls',
draggable : false,
renderTo: Ext.getBody(),
modal : true,
closable:true,
closeAction : 'destroy',
title : 'Video Collaboration',
tbar : [ {
xtype : 'label',
text : 'Player'
} ],


items : [ {
xtype : 'panel',

} ],
listeners : {
afterrender : function() {

},

close:function(){

},

beforeclose:function( panel, eOpts ){
}
}
})


please help..!

jdkhamba
23 Dec 2015, 4:53 AM
Seems to work fine when I try the same thing in a fiddle:

https://fiddle.sencha.com/#fiddle/12vv

Can you reproduce it in a fiddle? Also, as per the code you have provided, I don't see any grid panel anywhere, just a regular panel. How is it appearing in the attachment you have provided?

tina@user
28 Dec 2015, 10:56 PM
thanx a lot for your help...


i am opening a window over another window. i think that is the issue. i will check all the scenarios and let u know soon.