Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
70
Loop through all selected rows in Virtualized igGrid
posted

Hi,

Could you please provide a code sample that would loop through all selected rows on a rowVirtualization enabled version 2017.2 igGrid and return the column value for a Column called 'UUID'? The grid has enableCheckBoxes set to true.

My code (included below) fails when attempting to access non-rendered rows. The only other reference I have found to this is at the following URL, but the answer isn't expanded on in any great detail and relates to an older version of the control.

https://ko.infragistics.com/community/forums/f/ignite-ui-for-javascript/80275/virtualization-and-select-all-checkbox

Many Thanks.

var rowId;
var securities = new Array();

var rows = $("#SecurityGrid").igGridSelection("selectedRows");

$.each(rows, function (ix, el) {
rowId = el.element.attr("data-id");
var uuid = $("#SecurityGrid").igGrid("getCellValue", rowId, "UUID");
securities.push(uuid);
});

Parents
  • 17590
    Verified Answer
    Offline posted

    Hello John,

    Thank you for posting in our community.

    The limitation is no longer applicable and selectedRows method returns all the selected rows, including the scenario when Virtualization is enabled. 

    Attached you will find a small sample using igGrid with Virtualization and Selection (multiple selection is enabled) features. When "Get Selected Rows" button is clicked an alert pops up with the first name of every selected employee, regardless whether it is rendered in the current view or it is outside of the view pane. Please test it on your side and let me know whether it helps you achieve your requirement.

    Please feel free to contact me if you need any further assistance with this matter.

    6011.LoopSelectedRowsVirt.zip

Reply Children