views:

70

answers:

1

in my site , i have a jqgrid table.

by default, the names of the columns (header) is longer than the width for column, because that i set the name with an ellipsis.

however, when resizing the column, the short name with ellipsis stays.

how can i get it work automatic , like the ellipsis should disappear and change to the full name when there is enough space, when the user is expanding the column.

thanks

+1  A: 

You can add an event handler after the resizing finishes to reset the names. How are you storing / changing the names? If they're in an array, you can add a function like:

var columnNames = ['first', 'second', 'third'];    
$("#mygrid").jqGrid({
   ...
   resizeStop: function(newwidth, index){ 
      jQuery("#mygrid").jqGrid('setLabel',index,columnNames[index]);
   },
   ...
});
Adam
@adam thank you about the answer, but i need something automatically , in this solution i need to calculate the width and see how much characters it get in ... , i want to see if possible to declare one long header and the display is according to size width
Haim Evgi