mirku mirku - 4 months ago 63
HTML Question

JQuery jQGrid expand /collapse grid on caption layer click

Is there any method to expand/collapse the grid by clicking on the caption layer?
I have 3 very large tables that are displayed on a 1680x1050 screen which are loaded by default, collapsed, and each time the user wants to expand/collapse a table, he has to click on the expand/collapse button of the caption layer, which is "very far" positioned.

Answer

You can use construct like

$(".ui-jqgrid-titlebar-close",$("list")[0].grid.cDiv).click();

You can see live demo here.

UPDATED: Probably it will help you just to place the minimize element of from the capture bar on the left size instead of default right position? You can do this with

.ui-jqgrid .ui-jqgrid-titlebar-close {position:relative;top:auto;margin:0;float:left}

see updated demo here.

UPDATED 2: See also one more example where click on the whole grid capture follows to the expand/collapse the grid.

Comments