Note that there are some explanatory texts on larger screens.

plurals
  1. POseveral call when I hit a action inside jqgrid with jquery
    text
    copied!<p>I have a jqgrid component inside my page and the rows of the grid are create with values and actions, for example:</p> <pre><code>colum: name adresss job edit row 1: jorge my adress architect [value] </code></pre> <p>I populate the grid with several rows from a database and aech row have a value in column edit to the personal page for editing actions.</p> <p>this value have this structure:</p> <pre><code>&lt;div&gt;&lt;span class="edit" idperson="' + items[i].id + '"&gt;Edit&lt;/span&gt;&lt;/div&gt; </code></pre> <p>in the same script I put this:</p> <pre><code>$('.edit').live('click', this.clickedit); </code></pre> <p>and the function is:</p> <pre><code>clickedit: function(){ $.ajax('person/personedit.htm', { cache: false, type : 'POST', data : { idperson: $(this).attr('idperson')}, success : function(response){ //some actions..... } }); }, </code></pre> <p>in my java code I have a spring controller that recieve this call from jquery and do something.</p> <p>The first time I clic the Edit action in a row all is OK, but after a while working with the application I see that a single edit action is called several times so the clickedit function execute 2, or 3 or 4 times and my java code are hit the same numbers of times.</p> <p>any idea about this issue???</p> <p><strong>UPDATE:</strong></p> <p>I start to using onCellSelect now. But I have a problem. In a single cell I can put 3 differents action in this way:</p> <pre><code>var actions = 'editedOK ? '&lt;div&gt;&lt;span class="edit1" idperson="' + items[i].id + '" &gt;EDITOK1&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="edit2" idperson="' + items[i].id + '"&gt;EDITOK2&lt;/span&gt;&lt;/div&gt;' : '&lt;div&gt;&lt;span class="editnook1" idperson="' + items[i].id + '"&gt;EDITNOOK1&lt;/span&gt;&lt;/div&gt;'; </code></pre> <p>if actions = true I see in the same cell "EDITOK1 EDITOK2" and if actions = false I see in this cell "EDITNOOK1"</p> <p>everyone of this actions have associates functions with differents behaviour when I clic in it.</p> <p>If I use onCellSelect it´s possible to determinate when I hit EDITOK1, when I hit EDITOK2 and when I hit EDITNOOK1. More important is to determinate between EDITOK1 and EDITOK2.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload