Question

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

Was it helpful?

Solution

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]);
   },
   ...
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top