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

[Solved] Restoring grid header "div.t-resize-handle"s

12 Answers 90 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Yauhen
Top achievements
Rank 1
Yauhen asked on 29 Sep 2011, 01:46 PM
Hi!

Is there an easy way to restore grid header "div.t-resize-handle"s position and to set proper handlers for new ones after showing/hiding grid columns?

Thanks.

12 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 04 Oct 2011, 12:32 PM
Hi Yauhen,

Can you please explain in more detail what are you trying to do? Please note that client-side column hiding and showing is currently being implemented, so you may want to wait for the official implementation (Q3 2011 in November) instead of hacking some workarounds in the present version.

Kind regards,
Dimo
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Oscar
Top achievements
Rank 1
answered on 02 Jan 2012, 04:56 PM
Hello Dimo.
In fact I have a similar problem as I think Yauhen tries to explain, and I'm using Q3 already.
When you use the new hideColumn javascript function to hide a column, it seems like the resize handler stays there and if you have now a larger column in the place of the one you hid you will see the cursor changes in the middle of the header because it is detecting the resize handler of the hidden column.
So it is really hard then (and this is not a desired effect for our clients) to resize the visible columns.
0
Oscar
Top achievements
Rank 1
answered on 03 Jan 2012, 12:19 PM
Calling to $.telerik.resizing.initialize() will not fix this.
As in that function code you look for the matching col element to the header index.
But in your new javascript function (hideColumn) you remove the col elements of the hidden columns, but the column cells stay there, so the result of all this is that you may be resizing the next column of the one you really want to resize.
0
Dimo
Telerik team
answered on 04 Jan 2012, 10:58 AM
Hi Oscar,

The problem with resize draghandles not reinitializing after column hiding/showing has been fixed on December 15, 2011. Please use the latest internal build.

Alternatively, you need to initialize resizing correctly, by passing the Grid client object as a parameter:

var grid = $("#GridID").data("tGrid");
$.telerik.resizing.initialize(grid);

All the best,
Dimo
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Oscar
Top achievements
Rank 1
answered on 04 Jan 2012, 11:34 AM
Sorry for asking this Dimo, but are you sure it has been fixed?
I have downloaded the latest internal build, but the issue still exists.
And reading the release notes of the internal build: http://www.telerik.com/versionnotes.aspx?nb=1&id=1731 I cannot find any point talking about it.
0
Oscar
Top achievements
Rank 1
answered on 04 Jan 2012, 11:37 AM
Sorry, in fact it is placing correctly (if I call the reinitialize function) the handlers, but the other issue I said has not been fixed (apparently).
When I resize a column after hiding one, I end up resizing the column next to the one I want to resize.
Example
Column1 column2 column3 column4

I hide then column 2, as the hideColumn function removes it's col element, when you try now to resize column3 you end up resizing column4, because the index of column3 is yet 2, but the col element with index 2 would be the col element of column4
0
Dimo
Telerik team
answered on 04 Jan 2012, 05:16 PM
Hello Oscar,

I can't reproduce the described problem locally by using the latest source, so I have uploaded a new internal build (2011.3.1304), please test with it. If the problem persist, please provide your Grid declaration (or even better - a runnable demo) and specify which browser version you are using.

Greetings,
Dimo
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Oscar
Top achievements
Rank 1
answered on 04 Jan 2012, 05:33 PM
With this latest internal build it works, though I'm trying to show the hidden columns when I resize any column and it is throwing now an exception.
When it tries to destroy the draggable data of the gridId-column-resizing, it says that _destroy() is undefined.
0
Oscar
Top achievements
Rank 1
answered on 04 Jan 2012, 05:54 PM
Am I right if I assume that this function should be destroy() and not _destroy() ?
I changed it in my minified file, but I'm not sure if I did the right thing or not.
Awaiting your answer, and thank you.
0
Dimo
Telerik team
answered on 05 Jan 2012, 08:26 AM
Hi Oscar,

The correct function name is _destroy and it is defined in telerik.draganddrop.js.

Can you please explain in more detail and with code snippets what exactly you are trying to do, so that I can test it locally?

Greetings,
Dimo
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Oscar
Top achievements
Rank 1
answered on 05 Jan 2012, 09:42 AM
Yeah, I did see now that there is a _destroy declaration in the draganddrop file, though the draggable object it gets does not have it (it has destroy only).
0
Dimo
Telerik team
answered on 05 Jan 2012, 11:15 AM
Hello Oscar,

Thanks for the JS code. After some code inspections, it turned out that the _destroy call should be without the underscore indeed. A _destroy method exists, however it is encapsulated and cannot be called directly.

The error does not occur in standard scenarios, because column showing is normally not called on column resize - that's why you are the first to report the problem.

The bug is fixed. I have updated your Telerik points.

All the best,
Dimo
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
Grid
Asked by
Yauhen
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Oscar
Top achievements
Rank 1
Share this question
or