Skip to main content
4 of 8
added 93 characters in body
bgmCoder
  • 3.6k
  • 16
  • 61
  • 103

Set the column width in GANNT view

When the GANNT view is being used, how could one resize the columns using jQuery without using the generated controlid (like in this example)? I'm looking for a way to do this in a re-usable javascript function.

I'm thinking to be able to find a control that has ListViewWebPartJSGrid in its id. It is possible that there would be more than one on the page, but that would work out.

[update]

Okay, I figured out how to fetch the control id (you can see the color change):

var $trackingGridID = $("[id$=_ListViewWebPartJSGrid_leftpane_mainTable]").attr("id");
$('#' + trackingGridID).css("background-color", "blue");

//this will fetch:  ctl00_ctl21_g_c3e5fead_d466_4448_9648_dcb92778921d_ListViewWebPartJSGrid_leftpane_mainTable

Now that I have the ID, it is a matter of figuring out how to modify the column widths...

bgmCoder
  • 3.6k
  • 16
  • 61
  • 103