Skip to content

Replies

0
Pieter
Pieter answered on Jan 11, 2017 10:03 AM

Thanks Mihoko.

I have updated all my grids to use <table> tags and ids.  The selection is now fixed and rendering also seem to have improved (delete buttons on hover look better etc.)  I'm guessing some of the CSS are based off the <table> tag.  

0
Pieter
Pieter answered on Jan 11, 2017 1:00 AM

Hi Mihoko

Thank you very much for the example.  I managed to track down why my code didn't work.  The selection only works under the following conditions:

  1. The base element needs to be a <table> element.  I was using a <div> which worked for rendering the table with check boxes etc. but not selection.
  2. The <table> element must have an id attribute defined even if you don't use it.  I'm guessing the select logic relies on it somehow.  I didn't have one defined as I had a reference to the element through react.
In case somebody else have similar problems, I had the following errors:

<div> Element with or without an id:

Uncaught Error: cannot call methods on igGridSelection prior to initialization; attempted to call method 'selectRow'
at Function.error (http://code.jquery.com/jquery-1.11.3.min.js:2:1809)
at HTMLDivElement.<anonymous> (http://code.jquery.com/ui/1.11.1/jquery-ui.min.js:6:9130)
at Function.each (http://code.jquery.com/jquery-1.11.3.min.js:2:2975)
at m.fn.init.each (http://code.jquery.com/jquery-1.11.3.min.js:2:835)
at m.fn.init.e.fn.(anonymous function) [as igGridSelection] (http://code.jquery.com/ui/1.11.1/jquery-ui.min.js:6:8872)
at PropertiesSelected.componentDidMount (http://localhost:49754/app.js:62136:38)
at http://localhost:49754/app.js:15247:26
at measureLifeCyclePerf (http://localhost:49754/app.js:15057:13)
at http://localhost:49754/app.js:15246:12
at CallbackQueue.notifyAll (http://localhost:49754/app.js:7690:23)

<table> element but no "id" attribute:
Uncaught Error: Syntax error, unrecognized expression: # thead th
at Function.ga.error (http://code.jquery.com/jquery-1.11.3.min.js:2:12731)
at ga.tokenize (http://code.jquery.com/jquery-1.11.3.min.js:2:18658)
at ga.select (http://code.jquery.com/jquery-1.11.3.min.js:2:21386)
at Function.ga [as find] (http://code.jquery.com/jquery-1.11.3.min.js:2:7364)
at m.fn.init.find (http://code.jquery.com/jquery-1.11.3.min.js:2:23660)
at m.fn.init (http://code.jquery.com/jquery-1.11.3.min.js:2:24231)
at m (http://code.jquery.com/jquery-1.11.3.min.js:2:393)
at e.(anonymous function).(anonymous function)._create (http://cdn-na.infragistics.com/igniteui/2016.2/latest/js/infragistics.lob.js:438:6450)
at e.(anonymous function).(anonymous function)._create (http://code.jquery.com/ui/1.11.1/jquery-ui.min.js:6:7983)
at e.(anonymous function).(anonymous function)._createWidget (http://code.jquery.com/ui/1.11.1/jquery-ui.min.js:6:10053)

Kind Regards,

Pieter