Forum
15:04
03/10/2012
The method call $('...').getGridParam('selrow')Â gives the sequential ID of the selected row if the grid is not sorted.
But after you sort by any column, it gives the primary key column of the seleced row (the one with {key: true} in the colModel).
Is there some configuration parameter or something to prevent this inconsistency?
I'm creating the grid from an HTML table using the function tableToGrid.
16:58
Moderators
30/10/2007
Hello,
Â
If you use key true the id shouldcome from that row.
Will be interesting from me if you put online example or post a code with some data.
Â
Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
20:53
03/10/2012
I made a jsfiddle where you can reproduce the problem.
16:52
Moderators
30/10/2007
Hello,
Â
This is not a bug not in jqGrid itself, but it is a bug in the user provided function tableToGrid.
I recommend yo to get the data as array and create the grid from scratch, not using this method.
Note that I plan to remove this method from the build in the next release and put it in the custom methods.
Â
   // Add data
   var a;
   for (a = 0; a < data.length; a++) {
      var id = null;
      if (rowIds.length > 0) {
         id = rowIds[a];
         if (id && id.replace) {
            // We have to do this since the value of a checkbox
            // or radio button can be anything
            id = encodeURIComponent(id).replace(/[.\-%]/g, "_");
         }
      }
      if (id === null) {
         id = a + 1;
      }
      jQuery(this).jqGrid("addRowData",id, data[a]);
   }
Â
Comment this fragment and one step above change the setting to:
Â
      datatype: "local",
       data : data,
      width: w,
      colNames: colNames,
      colModel: colModel,
      multiselect: selectMultiple
      //inputName: inputName,
      //inputValueCol: imputName != null ? "__selection__" : null
   }, options || {}));
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
47 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66