Hi I have jqgrid which on resize trigger a function so that it resizes according to window size. This function fine but I need that same function to work when the jqgrid loads so I am calling the function like this
$(window).bind("load", function() {
$('#' + grid_id).setGridWidth(width, true); //Back to original width
$('#' + grid_id).setGridWidth($('#' + div_id).width(), true); //Resized to new width as per window
});
But it is not working.
The same function is called when the window is resized like this
$(window).bind('resize', function () {
$('#' + grid_id).setGridWidth(width, true); //Back to original width
$('#' + grid_id).setGridWidth($('#' + div_id).width(), true); //Resized to new width as per window
}).trigger('resize');
And it works fine. What is wrong am I doing here.