Note that there are some explanatory texts on larger screens.

plurals
  1. POLinking from a column value in jqGrid to a new page using GET
    primarykey
    data
    text
    <p>I have created a jqGrid that contains some fields such as:</p> <p>job_id, name, etc</p> <p>What I am trying to do is make so that when the click on the value in the job_id column, it will redirect them to:</p> <p>job.php?job_id=(value that they clicked on)</p> <p>I started by trying to use the following as my colModel:</p> <pre><code>{ name:'job_id', index:'job_id', edittype:'select', formatter:'showlink', formatoptions:{baseLinkUrl:'job.php'}, width:50, align:'center' } </code></pre> <p>But what this results in is a redirection to:</p> <p>job.php?job_id=(row_id)</p> <p>I did some searching, and found a post by the developer of the open source version of this software who suggested using the following colModel and additional JS:</p> <pre><code>{ name:'job_id', index:'job_id', edittype:'select', formatter:'showlink', formatoptions:{baseLinkUrl:'#'}, width:50, align:'center' } loadComplete: function() { var myGrid = $("#home_list"); var ids = myGrid.getDataIDs(); for (var i = 0, idCount = ids.length; i &lt; idCount; i++) { $("#"+ids[i]+" a",myGrid[0]).click(function(e) { var hash=e.currentTarget.hash;// string like "#?id=0" if (hash.substring(0,5) === '#?id=') { var id = hash.substring(5,hash.length); var text = this.textContent; location.href="job.php?id="+text; } e.preventDefault(); }); } } </code></pre> <p>But this is not compatible with IE. In addition to this, when displaying a large number of rows in the jqGrid, it takes a extremely long time to load, say 5 seconds + for 500 rows.</p> <p>I'm going to keep working on this, but is this something that anyone else has done?</p>
    singulars
    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.
 

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