Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>@Erik got me on the right path on this one. His solution works, but preserves the existing pseudo-modal popup confirmation UI, which I wanted to avoid. </p> <p>It also doesn't capitalize on the services the <a href="http://www.trirand.net/demoaspnet.aspx" rel="nofollow noreferrer">JqGrid ASP.NET component</a> provides. The component actually takes care of all CRUD operations as long as it's wired up to a properly configured data source (ObjectDataSource, SqlDataSource, etc). </p> <p>This missing piece for me was the mechanics behind the component's CRUD operations. By poking around with Fiddler I was able to see that it POSTs the relevant data to the same page, with the ClientID of the JqGrid object in the querystring:</p> <pre>MyPage.aspx?jqGridID=ctl00_ctl00_Content_Content_MyJqGrid</pre> <p>For deleting, the contents of the POST are as @Erik describes:</p> <pre>oper=del&id=18</pre> <p>So I've been able to duplicate the operation on my own so that I retain complete control of the whole process:</p> <pre><code>$(".DeleteButton", grid).click(function(e) { var rowID = getRowID(this); $(grid).setSelection(rowID, false); if (confirm('Are you sure you want to delete this row?')) { var url = window.location + '?jqGridID=' + grid[0].id; var data = { oper: 'del', id: rowID }; $.post(url, data, function(data, textStatus, XMLHttpRequest) { $(grid).trigger("reloadGrid"); }); } else { $(grid).resetSelection(); } // if }); // click getRowID = function(el) { return $(el).parents("tr").attr("id"); }; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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