Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>[...] dataKeyFields: "EmployeeNumber", //Is this how you set the dataKeys? [...]</p> </blockquote> <p>Close enough. It's actually 'primaryKey' like so:</p> <blockquote> <p>[...]<br> primaryKey: "EmployeeNumber",<br> [...]</p> </blockquote> <p>And for the second part I guess that's not obvious right away, however the row you get passed as an argument is the actual DOM TR element that is being selected and you can (as your current setup suggest) plainly pick the key form its cells like so:</p> <pre><code>var rowKey = $(ui.row.element).children().eq(0).text(); //may need to parse if int </code></pre> <p><em>Note: The eq() method takes zero based index and in terms of structure the child elements of the row are the cells. In you case the primary key column is the first (and only) and therefore has index 0.</em> </p> <p>Another approach I find more programmatic-friendly is to get the key straight from the data source (clearer to read and no need for parsing):</p> <pre><code>var rowKey = ui.owner.grid.dataSource.dataView()[ui.row.index].EmployeeNumber; </code></pre> <p><em>Note: 'owner' is the actual widget in charge of the event ( Selection) and it has a reference to your 'grid' and from there you can access the data source. To get the records use either '.data()' or '.dataView()' - the latter contains only the actual visible rows on which the index is based and should be used if any additional features are enabled ( paging, sorting, filtering..).</em></p> <p>Here's the documentation page that (at the bottom) describes what the selection events provide - <a href="http://help.infragistics.com/NetAdvantage/jQuery/2012.1/CLR4.0?page=igGrid_Selection_Overview.html" rel="noreferrer">http://help.infragistics.com/NetAdvantage/jQuery/2012.1/CLR4.0?page=igGrid_Selection_Overview.html</a></p> <p>And here's a full API reference: <a href="http://help.infragistics.com/jQuery/2012.1/ui.iggridselection#events" rel="noreferrer">http://help.infragistics.com/jQuery/2012.1/ui.iggridselection#events</a> - from here you can dig into any grid / grid feature / data source API and events have sample snippets with all useful parameters listed.</p> <p>P.S. If the intent is not to control the users' selection, consider using the '-ed' event as in 'rowSelectionChanged' - parameters available are identical. The difference is the '-ing' is fired mid-selection and it blocks the UI, which can result in a not very responsive app if you add some more heavy logic.</p>
    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.
 

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