How would you select multiple rows? I have an array of data that i select from a map (Several different OBJECTIDS). I would like to be able to select the rows in the grid that have the same OBJECTIDS.
Here are a few links of the example code i am trying to use to select multiple rows:
https://www.jqwidgets.com/community/topic/select-a-row-with-value-instead-of-index/
https://jsfiddle.net/jqwidgets/FQxrf/
Here is my code:
//using a button to create the row selection
$(“#selectRowByValue”).on(‘click’, function () {
var rows = $(‘#roomUseTable’).jqxGrid(‘getrows’);
console.log(rowsCount)
var myroomEditData = [];
for (var i = 0; i < rows.length; i++) {
const valueObjectID = $(‘#roomUseTable’).jqxGrid(‘getcellvalue’, i, “OBJECTID”);
console.log(“roomsAssignedData Data from the map”)
console.log(roomsAssignedData)
myroomEditData.push(
valueObjectID
);
console.log(“myroomEditData”)
console.log(myroomEditData)
//comparing the data from the map to the data in the grid
const intersection = myroomEditData.filter(element => roomsAssignedData.includes(element));
console.log(intersection)
};
});
This gives me the OBJECTIDs in the grid. My example shows 3 rows and it gives me back the three rows OBJECTIDs (myroomEditData). When I select the data in the map it gives me the OBJECTIDs of the data that it selected (roomsAssignedData) from a different piece of code.
How would I pass more than one value to get it to select (value == "Ikura”)? The values are in my array (myroomEditData). I tried (value == myroomEditData) but it only selects the 1st row even if that’s not the data selected in the map.