0

Is it possible to have a field in my data array with the visibility status of each item and make slickgrid draw only the rows with visibility field true?

I have a large dataset and need to delete several items from my array and the delete operation is slow, but if I could mark the items as invisible, instead of delete, I think it will speed things up. I'm already using filters so I can't use a filter to hide the items...

rgomesf
  • 702
  • 1
  • 10
  • 20

1 Answers1

0

If you use the DataView, just create a filter that checks the "isDeleted" property and specify it in the DataView.

Tin
  • 9,082
  • 2
  • 34
  • 32
  • I use DataView but I already have other filters. I need to know the number of elements not deleted, and the number of actual elements returned by the other applied filters. can I create independent filters so I can get the number of not deleted, and the number of items filtered by the other filters? – rgomesf Apr 11 '12 at 09:21
  • You can't have multiple filters. I don't really get why you can't just remove the deleted elements from the array and store them elsewhere while your are making your XHR request to delete them. – Tin Apr 11 '12 at 17:51
  • I am removing them from the array, but I have 200,000 rows, and need to be able to remove a variable number of rows, not sequential, from the array, so if I need to remove 100,000 I end up doing 100,000 splices and it takes time, specially with ie7. If I could only hide the rows, I think it would be much faster... – rgomesf Apr 12 '12 at 08:35
  • Just found a way of doing what I wanted without splice. End up adding a condition in the filter function to check if the item.isDeleted==true before the other filters. – rgomesf Apr 12 '12 at 16:36
  • 1) If you are removing 100'000 items from a 200'000-item array, don't use splice. Create a new array and copy items on the fly. Pick the implementation depending on the number of items being removed. 2) This is what I was suggesting in the first place. – Tin Apr 12 '12 at 16:45
  • Sorry. I didn't understand you suggestion at first. – rgomesf Apr 13 '12 at 10:49