views:

130

answers:

1

I need to catch the event where the columns are resized. How do I do that?

A: 

It seems to me you should use resizeStop event (see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:events&s[]=resizeStop#list_of_events)

UPDATED: After you resize a column header in the jqGrid it calls resizeStop event. For example

jQuery('#list').jqGrid({
    caption: 'My caption',
    url: myUrl,
    resizeStop: function (newwidth,index) {
      alert('Column #' + index + ' has now size ' + newwidth + ' px');
    },
    // other jqGrid parameters
});
Oleg
I realise the problem for me is not so easily solve... You see, I need to wordwrap the td contents, and the only way I could do it was to wrapInner the contents for each grid td with a DIV and set a fix width on that DIV based on the column's header width.simply using break-word on TD does not wrap the contents of the TD (which has a fixed width)after I did that... col resize does not calculate the inner divs I've inserted. I can't imagine how I can calculate the correct widths for each inner div (n position, n+1 position, n-1 position).. massive calculations, which works sweet on the THs.
Brandon
I had a go with the resizeStop (useful)... only to realise all the additional calculations needed for all the inner Div width I've inserted.
Brandon
close to giving up on finding a wordwrap + resize column solution, which will work for both FF, IE7 and IE8
Brandon
posted related question athttp://stackoverflow.com/questions/2994343/how-to-implement-wordwrap-on-jqgrid-which-works-on-ie7-ie8-and-ff
Brandon