With virtualization set to False in "continuous" mode, adding "ui-iggrid-deletedrecord" class to the selected row will have the deleting styles (italic and cross-line) stayed. However, my code to set a selected row for deletion below does not take effect when virtualization set to True. Any idea?
mySelectedRow.element.addClass("ui-iggrid-deletedrecord");
Thanks!
hi Erica,
It works for me. Maybe it's some edge case or you are doing something wrong.
Can you check the element returned by mySelectedRow.element? Adding a class to it with jQuery should not be a problem.
It will be very helpful, if you attach a sample that reproduces the issue.
Regards
Lyubo
After a further investigation, the problem happens before or after a setCellValue() function is called. Attached sample is the actual scenario (checking/unchecking a checkbox for delete/undelete) that I need to achieve.
setCellValue and addClass("ui-iggrid-deletedrecord") can co-exist without problem when virtualization is set to False.
You are welcome :)
That works perfectly. I don't need a sample anymore. Thanks!
You are pretty close! You just need to wrap that tr object in $(tr_object) and that will give you a reference to jQuery object.
This way you will be able to use addClass.
Let me know if that doesn't work and tomorrow when I go to work I'll create a sample
regards
The row object returned by the rowAt method is a TR, which is different from the row returned from .igGrid("selectedRow") and that does not support .addClass(). To reduce the turnaround time, can you attach a working sample for your suggestion?
You've turned autoCommit ON, which means that the grid will re-render with every change. That's why you can't apply the class.
With virtualization turned off because of some optimizations made in the grid, only the edited cell/row are re-rendered and the code works in that case.
You may achieve your goal even with virtualization turned on by saving the row-index in the grid and after you edit the cell (grid re-renders) you can get
the row by index using grid method - rowAt and apply to that row .addClass("ui-iggrid-deletedrecord"). However, with your next change the grid will re-render again
and the previous change will disappear unless you save all "deleted" records and addClass to all of them with every delete row call.
Hope that helps.