This is a migrated thread and some comments may be shown as answers.

The resize event

4 Answers 170 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Jacob
Top achievements
Rank 1
Jacob asked on 01 Nov 2011, 03:24 PM
Hi!

It seems like the resize event for Splitter does not supply the pane that got resized, as documentation says.

E.g. a collapse event gives this to work with:
Object { pane=div#leftPane.k-pane, preventDefault=function(), isDefaultPrevented=function()}

While resize only this (note the absence of "pane"):
Object { preventDefault=function(), isDefaultPrevented=function()}


How can I get the size of pane and which pane got resized without this? Am I missing something?

Thanks!
/Jacob

4 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 01 Nov 2011, 04:55 PM
Hello Jacob,

Actually the documentation is not correct in this case. The Splitter's Resize event involves more than one pane (practically all of them), so you can't get only one as an event argument. If you need to find out the new pane sizes, use standard jQuery selectors and methods, such as outerWidth() or width().

Greetings,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Ellin
Top achievements
Rank 1
answered on 09 Dec 2011, 07:42 PM
That isn't working for me. The event returns the old sizes. Not the new ones.

function toolboxes(e){
console.log(e);
$(".toolbox").each(function() {
$(this).width( $(this).parent().width() + "px" );
console.log($(this).parent().attr("id") + " = " + $(this).parent().width() )
});
}

0
Dimo
Telerik team
answered on 14 Dec 2011, 01:05 PM
Hello Ellin,

Please use setTimeout to get the new panes' dimensions. Currently the reisize event is triggered by the Kendo Resizable object, which is also used by the Splitter to readjust its layout. As a result, the defined event handler is executed before the Splitter has set the new pane sizes. We will think whether and how to change this behavior in the future to make it easier for the developer.

Regards,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Joe
Top achievements
Rank 1
answered on 02 Sep 2012, 09:42 PM
Just to leave this thread closed: kendoui.web.2012.2.710.open-source (and forward I suppose) has an event called layoutChange which seems to get the sizes correctly.

Joe
TSolucio
Tags
Splitter
Asked by
Jacob
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Ellin
Top achievements
Rank 1
Joe
Top achievements
Rank 1
Share this question
or