Ignite UI 13.2
We are experiencing some inconsistencies with the igSelection API. It isn't honoring our API calls and displays this abnormal behavior:
mode: rowmultiple: truerequireSelection: true - (Setting this value to false causes an error - which I believe it shouldn't. Check into this for me please.)enableCheckboxes: true
Scenario 1
1. Select the first record on page 1.2. Invoke this method in the API: igSelection("deselectRow", 0);3. Select the first record on page 1. (This record should now be selected by the system)
Result: No UI updates. Upon inspecting the event handler, the API thinks the first record was just deselected. The API call did not correctly deselect this record. Even the event args reflect the new state as "OFF", which is incorrect.
Scenario 2
1. Select a row on page 1.2. Click on page 2 using the UI.3. Invoke this method in the API: igPaging("pageIndex", 0);
Result: Rows are NOT marked with the appropriate selection styles.
Scenario 3
1. Select the first record on page 1.2. Click on page 2 using the UI.3. Click on page 1 using the UI.4. Noticed that the first record is correctly highlighted.5. Click on that first record to deselect it.
Result: Row is still bolded but no longer active. This trend continues on every other record you select.
(Thoughts?)
Hello Daniel,
Thank you for posting in the Infragistics community !
Please find answers / comments on your questions below:
1. requireSelection: true - (Setting this value to false causes an error - which I believe it shouldn't. Check into this for me please.)
This is a property of the RowSelectors feature - if set to true you need to have the Selection feature enabled also. (if you fail to enable selection the grid will not be rendered). If false the feature will be enabled regardless off the Selection feature state. It is strange if you receive an error when set to false. Please send me a sample that reproduces this or feel free to modify mine and send it back.
2. Scenario 1)
I am not able to reproduce this issue. The row was properly deselected after calling the API method "deselectRow" and then I successfully selected it again though the UI. This is expected behavior. It is strange if you face issue.
3. Scenario 2)
When you interact with other features of the grid (such as going to page 2 in this example) the state of rows that have been selected will be LOST. After that it does not matter if you return to page 0 though the UI or the API - the rows will not be selected as you have seen. This is expected.
However in 14.1 volume the persistence of features states have been introduced and replaces the previous default behavior (the one mentioned above). If you follow the same scenario in 14.1 after you return to page 0 the same row/rows will be still selected due to the persistence feature. For more details on that please refer to:
http://ko.infragistics.com/help/jquery/iggrid_selection_overview.html#selection_persistence
http://ko.infragistics.com/community/blogs/marina_stoyanova/archive/2014/06/02/feature-persistence-in-the-jquery-iggrid-and-ighierarchicalgrid.aspx
4. Scenario 3)
When you return to page 1 it is expected that the row will not be selected (as stated above, because of the persistence non available in 13.2).
I am attaching the sample I used to test these. Please run it and let me know if you still face issues with it or if you are observing the same default behaviors which I described above.
Looking forward to hearing from you.
First issue I see with your example is the check boxes aren't rendering for the row selectors. Until that shows up I can't get the iggridrowselectorscheckboxstatechanged event to fire.
IE 11
I apologize that I didn't notice checkboxes were not rendered, it is because the property should be written with capital letters as follows;
enableCheckBoxes: true,
However it seems that this rookie mistake broke the grid selection functionality and the way I described that the grid behaves is not the same when I got the checkboxes rendered. Also tit seems that changing the pageIndex is not an interaction that will make the selection state get lost (as will happen if you change the pageSize for example from the UI)
Please see my comments now:
The method properly deselects the row and then clicking on the row makes it selected again. Works fine.
I experienced the same result - rows that have been selected currently are not selected. I will further investigate that, however I believe it has a reason for this why changing the pageIndex through the API or UI has a different impact.
As mentioned in my last post clicking on the selectedRow will NOT make it deselected. This is expected.
I have also not been able to see any error occur when requireSelection is set to false. Please see the modified sample and check. Please confirm if you see the same behavior as I described above. If this is so then Scenario 1) and 3) are expected for sure and I will take the time to investigate further Scenario 2. I will then update you with my findings.
For the selection exception, I think I have a misunderstanding as to what RequireSelection is used for. I can replicate the issue by removing this line from your declaration:{ name: "Selection", mode: "row", multipleSelection: true, activation: true,}
If require selection has been explicitly denied, why would we register the feature on the grid? If we don't, then we see the attached error. My initial thought when I set this property to false was: "Ok cool, we don't care for the CSS styles that the selection feature introduces so by setting this to false, I don't have to load the selection feature." WRONG! It apparently is still required. What's the insight here so we know moving forward?
Click the image for full size...
First let me apologize for late response. The RequireSelection property determines if RowSelectors will throw an error if Selection is not enabled for the grid (when initializing). If set to false and selection is not enabled grid will render fine.
However, when checkboxes are enabled checking them calls methods from the igGridSelection widget and this results in error since it is not available. This is expected behavior.
I suggest that you disable the RowSelectors checkboxes in case you do not use the Selection feature.
Please let me know if you have further questions on the issue.
Please let me know if you need any further assistance on the matter.