jqGrid row selected but not highlighted -


I want to select and deselect a row multiple times.

My code is so far: ( last selected is a global var ):

  first selection Do: Function (id) {if (lastSelected! == id) {grid setSelection (ID); Final selected = id; Return; } And {grid.reset selection (ID); Final selected = faucet; }}  

The code works fine, but the row is highlighted only after the first click. Click the second time to highlight it and when I click it next time, and it is clicked after 3 times, 5th, then it is undeclared ... it behaves like the ones (I have Modal is the row that is selected, then the crop occurs), but is not highlighted.

without grid.getSelection (id) This will not be highlighted at all, but it is still working as though it was selecting and unselecting.

It looks like the main error in your code first select return If the value is not returned to << code> false , the standard processing will continue and the line you previously selected from the setSelection is to be unselected. Could.

To fix the problem, you should return the false to first select . In addition, I recommend using the grid variable instead of $ (this) and use the standard selrow parameter of jqGrid instead of use To make the previous selected variable resultant code may be

 Select  before: function (row, e) {Var $ self = $ (this), selectedRowid = $ self JqGrid ("Getgraig Para", "Sero"); If (selected rovid === queued) {$ self.jqGrid ("Resetsetback"); } And {$ self.jqGrid ("setSelection", queued, true, e); }      return false; // do not process standard selection)  

There is a related demo.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -