I have a jqgrid table that has a username and password column, and if I could add automatic selection of a cell's entire contents when the cell is clicked, that would be of great benefit to those who use the table for their work.
Here is what I have so far:
$("#theTable").jqGrid({
[...]
colNames:[[...],'Username', 'Password',[...],
colModel:[
[...]
{name: 'username', index: 'username', width: 110, sorttype: 'text', cellattr: function () {return 'class="selectcell"'}},
{name: 'password', index: 'password', width: 110, sorttype: 'text', cellattr: function () {return 'class="selectcell"'}},
[...]
],
});
Then later on...
$(".selectcell").click(function(){
this.select();
});
I took that $.click()
from code that automatically selects an entire textbox whenever it is clicked on. It functions perfectly there, but it isn't working as is. How can I make this work?